先看一段代码(php例子)
1、表单代码(form.php)
<?php
header("content-type: text/html; charset=utf8");
?>
<iframe name="testiframename" style="display:none;"></iframe>
<form target="testiframename" method="post" action="formaction.php">
<input type="text" name="username"/>
<input type="password" name="password"/>
<input type="submit" value=" 提 交 " />
</form>
2、action代码(formaction.php):
<?php
echo "<script>alert('test....');</script>";
?>
ok,上面的代码非常简单,但实现了表单提交无刷新....哪这是为什么呢?
哦~其实很基础的东西......就是form标签的属性问题.....如图:
更多iframe标签实现form表单提交无页面刷新(不需要js)---解析。
