如何实现表单提交后不重新刷新当前页面

<form name='form1' id='form1' action='/xbcw/cw/xx_xx.action' method='post'>

  <input type="button" />

  <input type="button" />

</form>


当我点击保存提交FORM表单后,如何让当前页面维持不变(即不刷新当前页)?

在FORM表单后添加一个iframe

  <iframe ></iframe> 


点保存提交事件里面需要将target改为iframe的名字:

  JS:document.forms[0].target="rfFrame";

JQuery:$("#f2").attr("target","rfFrame");



这样即提交了FORM保存了数据,页面也不会跳转.

相关文章:

  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-03-08
  • 2022-12-23
  • 2021-09-14
猜你喜欢
  • 2022-12-23
  • 2021-12-27
  • 2021-08-06
  • 2021-11-27
  • 2021-12-27
  • 2022-12-23
  • 2021-12-06
相关资源
相似解决方案