开发者

how can I make a <a> tag so that when I click that <a> tag,the URL should not go in the address bar?

In My JSP ,I have an <a href="patient/tools.do?Id=<%=mp.get("FROM_RANGE") %>"> <%= mp.get("DESCRITPION") %></a> ....when i click the anchor tag the url normally goes in the Address bar.I want the UR开发者_运维百科L not to go in the Address bar.how can i do that?

Please note that <%=mp.get("FROM_RANGE") %> and <%= mp.get("DESCRITPION") %> are all scriptlets for getting value from java variables...

Thanks in advance!


You cannot. (Why do you need to do it anyway?)

But you could open the link via AJAX - but then you'd need to process the returned data via JavaScript. Or you could use frames. They are horrible and annoying for users though.


Investigate .htaccess and URL rewrites. I do not believe you can change the not change the url in an <a> tag. An example also of using javascript to change the url is in a game(mentioned on slashdot) that is played entirely in the url bar. http://probablyinteractive.com/url-hunter . Check out the source code and mabye you could derive something from that.


you can just use IFrame and change URL for that iframe. Make iframe as big as the page itself.


You have some options to do this:

  1. Wrap your contents in a frameset or iFrame.
  2. Load your contents dynamically using AJAX.
  3. If you have a control over the domain name, then you can use domain masking technique
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜