`
lpm528
  • 浏览: 81738 次
  • 性别: Icon_minigender_1
  • 来自: 厦门
社区版块
存档分类
最新评论

form.submit()方法缺陷

    博客分类:
  • JSP
 
阅读更多
<SCRIPT type='text/javascript'> 
function firstpage(){ 
var theform=document.getElementById('fmcc'); 
theform.action=theform.action+'?curpage=2';
theform.submit();
}
</SCRIPT>

 用这种方式在action后面添加参数,可以提交,但在问号后添加的参数不能传递,前台地址栏为:

http://localhost:8080/pageTest/lpm/step.action   没有带上参数

二、

 

<SCRIPT type='text/javascript'> 
function firstpage(){ 
var theform=document.getElementById('fmcc'); 
theform.action=theform.action+'?curpage=2';
document.location.href=theform.action;
}
</SCRIPT>

 用这种方式可以传递成功,前台地址栏位:

http://localhost:8080/pageTest/lpm/step.action?curpage=2 有带上参数

分享到:
评论

相关推荐

Global site tag (gtag.js) - Google Analytics