先看一段代码(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)---解析相关文章请关注PHP中文网!
每个人都需要一台速度更快、更稳定的 PC。随着时间的推移,垃圾文件、旧注册表数据和不必要的后台进程会占用资源并降低性能。幸运的是,许多工具可以让 Windows 保持平稳运行。
Copyright 2014-2025 https://www.php.cn/ All Rights Reserved | php.cn | 湘ICP备2023035733号