是否有可能将一个锚点添加到FORM post / get? [英] Is it possible to add an anchor to a FORM post/get?

查看:185
本文介绍了是否有可能将一个锚点添加到FORM post / get?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

 < form 

我注意到在Firefox中,我可以添加一个#MyAnchor标签到action属性中。行动= #MyAnchor >
< input type =textname =a/>
< input type =textname =b/>
< input type =submit/>
< / form>

当表单提交时,锚点自动显示在URL中,如



mypage.aspx?a = 1& b = 2#MyAnchor

然而,这在IE上不起作用。无论如何,我可以为两个浏览器找到一个快乐的媒介吗? 只是一个猜测,但你有没有尝试过使用页面+锚名称。

 < form action =mypage.aspx#MyAnchor> 


I noticed that in Firefox I can add a #MyAnchor tag to the action attribute like...

<form action="#MyAnchor">
   <input type="text" name="a" />
   <input type="text" name="b" />
   <input type="submit" />
</form>

and when the form is submitted, the anchor automatically shows up in the URL like

mypage.aspx?a=1&b=2#MyAnchor

However, this doesn't work on IE. Is there anyway I can find a happy medium for both browsers?

解决方案

Just a guess, but have you tried using the page + the anchor name.

<form action="mypage.aspx#MyAnchor">

这篇关于是否有可能将一个锚点添加到FORM post / get?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆