创建书签:附加当前 URL 和特定字符串
我正在尝试创建一个小书签,它将更改我当前所在页面的 URL,并加载更改了 URL 字符串的新页面。我已经查看了小书签上的许多其他线程,但还没有找到适合我的解决方案。
我希望能够更改如下所示的 URL:
http://mywebsite.com/directory/ page.html?referral=Google&visit=1
至:
http ://mywebsite.com/directory/page.html?dog=Fido&cat=Mittens
三个目标:
1) 删除现有 URL 中 ? 之后的所有内容。标记。
2) 在问号后面添加“dog=Charlie&cat=Mittens”。
3)立即加载这个新页面,使用新的URL
这看起来很简单,但我一直不知道如何做到这一点。任何帮助将不胜感激!
I am attempting to create a bookmarklet that will change the URL of the page I am currently on, and load a new page with the URL string changed. I have reviewed a number of other threads on bookmarklets, but I haven't found a solution that works for me.
I would like to be able to change a URL that looks like this:
http://mywebsite.com/directory/page.html?referral=Google&visit=1
to:
http://mywebsite.com/directory/page.html?dog=Fido&cat=Mittens
The three goals:
1) Delete anything in the existing URL after the ? mark.
2) Append "dog=Charlie&cat=Mittens" after the question mark.
3) Immediately load this new page, with the new URL
It seems simple enough, but I have not been able to figure out how to do this. Any help would be greatly appreciated!
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
试试这个:
Try this: