How do I combine an anchor tag AND a passed variable in an HTML HREF?

此生再无相见时 提交于 2019-12-03 10:29:35

问题


Say I have an anchor somewhere on a different page:

<A NAME="blah">

On the page I'm currently on, I want to go that that anchor on that different page while also passing a GET parameter, such as, for example:

<A HREF="otherpage.htm#blah?data=1234">Good Stuff!</A>

This doesn't seem to be working for me. It loads the page and passes the variable but doesn't go to the anchor. I've searched for examples on the anchor tag, and there's tons of them, but nobody talks about jumping to an anchor in a page while also passing parameters in the URL.


回答1:


The bookmark always goes last.

<A HREF="otherpage.htm?data=1234#blah">Good Stuff!</A>


来源:https://stackoverflow.com/questions/10158283/how-do-i-combine-an-anchor-tag-and-a-passed-variable-in-an-html-href

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!