Javascript 如何使用IP本身的额外参数更改url?

Javascript 如何使用IP本身的额外参数更改url?,javascript,Javascript,我有一个可以访问我的应用程序的URL,在应用过滤器后,我应该能够传递带有值的参数,并在URL中替换 window.location.search.substring(1) 从此URL访问应用程序 http://localhost:3000/dashboard/abcd123#bordered=true&titled=true 应用过滤器后,需要将url更改为 http://localhost:3000/dashboard/abcd123?company_name=value#bord

我有一个可以访问我的应用程序的URL,在应用过滤器后,我应该能够传递带有值的参数,并在URL中替换

window.location.search.substring(1)
从此URL访问应用程序

http://localhost:3000/dashboard/abcd123#bordered=true&titled=true
应用过滤器后,需要将url更改为

http://localhost:3000/dashboard/abcd123?company_name=value#bordered&titled
我需要换一个

"#bordered&titled" with "?company_name=value#bordered&titled"
使用 与

let str=”http://localhost:3000/dashboard/abcd123#bordered=true&titled=true"
让result=str.split(“#”)。join(“?company_name=value#”)。replace(/=true/g,”)

console.log(result)
是什么阻止了您进行所述的替换?