读书人

get post混同提交 同时url中有锚点

发布时间: 2012-11-23 00:03:43 作者: rapoo

get post混合提交 同时url中有锚点
post和get组合提交

1,get + get : action中的查询字符串会消失掉
2,get + post : 可以得到get和post的数据,如果get和post有相同的name,则get的数据在post的前面
3,get + url中有锚点 : IE6,7,8会把锚点丢掉,ff3.5,chrome3.0,safari4,opera10会把锚点保留下来.
4,post + url中有锚点 : 所有浏览器都保留锚点.

总结:
如果您需要提交的页面有锚点的话最好用post提交,非要get提交?!!! 那只好自己慢慢拼接一个get串了,document.form1.action=XXX?need1=free#need2=freedom...


     <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"><HTML><HEAD><TITLE>帮助</TITLE></HEAD><style>*{    margin: 0px;    padding: 0px;}</style><script>function init(){   }</script><body onload="init()">    <form name="form1" action="http://www.google.cn/intl/zh-CN/images/logo_cn.gif?aaa=ccc" method=get>        <input name=inp1 value=c2 />        <input type=submit />    </form>        post和get组合提交        1,get + get : action中的查询字符串会消失掉    2,get + post : 可以得到get和post的数据,如果get和post有相同的name,则get的数据在post的前面    3,get + url中有锚点 :  IE6,7,8会把锚点丢掉,ff3.5,chrome3.0,safari4,opera10会把锚点保留下来.      4,post + url中有锚点 :  所有浏览器都保留锚点.        总结:        如果您需要提交的页面有锚点的话最好用post提交,非要get提交?!!!  那只好自己慢慢拼接一个get串了,document.form1.action=XXX?need1=free#need2=freedom...</body></HTML>




by: 天堂左我往右

读书人网 >操作系统

热点推荐