将 urlVariable 附加到下一页的链接
如何设置页面以将 urlVariable 附加到其链接中?
例如,我有 3 个不同的页面,并且所有页面都链接到同一页面,例如
receive.html
第一页链接:
receiver.html?sender=1
第二页链接:
receiver.html?sender=2
第三页链接:
receiver.html?sender=3
当单击第一页时,它会将用户发送到内部有许多传出链接的 receive.html,并且脚本会将变量附加到其所有传出链接中,具体取决于上面三页?
receive.html
outgoinglink.html?sender=1
outgoinglink2.html?sender=1
outgoinglink3.html?sender=1
,如果使用第二页,receiver.html 将附加
?sender=2
在其内部的所有链接上,依此类推。
How do i set a page to append a urlVariable into its links?
for example, i have 3 different pages and all are linked into the same page, e.g.
receiver.html
first page link:
receiver.html?sender=1
second page link:
receiver.html?sender=2
third page link:
receiver.html?sender=3
when the first page is clicked it will send the user to receiver.html which has many outgoinglinks inside, and the script will append the variable into all its outgoing links depending on the three pages above?
receiver.html
outgoinglink.html?sender=1
outgoinglink2.html?sender=1
outgoinglink3.html?sender=1
and if second page is used, the receiver.html will append
?sender=2
on all its link inside and so on and so forth..
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
那么您可以使用本文中显示的函数(http://stackoverflow.com/questions/901115/get-query-string-values-in-javascript)来获取您的参数
,然后将您需要的内容附加到所有 href:
Well you could use the function shown in this post (http://stackoverflow.com/questions/901115/get-query-string-values-in-javascript) to get your parameter
then attach what you need to all href: