现在的位置: 首页 > 综合 > 正文

解决Eclipse编辑JavaScript时卡的问题

2018年08月18日 ⁄ 综合 ⁄ 共 1262字 ⁄ 字号 评论关闭

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... 

 

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

 

抱歉!评论已关闭.