当前位置:网站首页>form 表单提交后,使页面不跳转[通俗易懂]
form 表单提交后,使页面不跳转[通俗易懂]
2022-07-31 15:37:00 【全栈程序员站长】
大家好,又见面了,我是你们的朋友全栈君。
- form 表单提交数据,往往会刷新页面,数据提交后会跳转到其他页面
- 如果不需要刷新页面时,可以通过ifame实现无刷新。 在form表单下定义一个
ifame将 form 的target属性指向 iframe 的name属性,这样就实现了不刷新页面的form提交。
示例:
<form action="url" enctype="multipart/form-data" target="frameName">
<input type="file">上传文件
<button>提交</button>
</form>
<iframe src="" frameborder="0" name="frameName"></iframe>数据提交后,页面不会刷新跳转。对iframe,设置需要的样式,即可。
发布者:全栈程序员栈长,转载请注明出处:https://javaforall.cn/127976.html原文链接:https://javaforall.cn
边栏推荐
- The use of button controls
- Public Key Retrieval is not allowed error solution when DBeaver connects to MySQL 8.x
- ansible study notes 02
- 长得很怪的箱图
- R language test whether the sample conforms to normality (test whether the sample comes from a normally distributed population): shapiro.test function tests whether the sample conforms to the normal d
- TRACE32 - SNOOPer-based variable logging
- 多主复制下处理写冲突(4)-多主复制拓扑
- [MySQL] Mysql paradigm and the role of foreign keys
- thread_local 变量的析构顺序
- 自动化测试如何创造业务价值?
猜你喜欢
随机推荐
01 Encounter typescript, build environment
TRACE32 - SNOOPer-based variable logging
Snake Project (Simple)
做事软件开发-法的重要性所在以及合理结论的认识
json到底是什么(c# json)
Applicable Scenarios of Multi-Master Replication (1) - Multi-IDC
JVM parameter analysis Xmx, Xms, Xmn, NewRatio, SurvivorRatio, PermSize, PrintGC "recommended collection"
多主复制下处理写冲突(4)-多主复制拓扑
Ubuntu Topic 5: Setting a Static IP Address
Implementing click on the 3D model in RenderTexture in Unity
更新数据表update
vb中如何连接mysql_vb怎么连接数据库「建议收藏」
TRACE32——常用操作
Deployment应用生命周期与Pod健康检查
Doing things software development - the importance of law and understanding of reasonable conclusions
TRACE32 - Common Operations
Synchronized和volatile 面试简单汇总
Applicable scenario of multi-master replication (2) - client and collaborative editing that require offline operation
.NET 20周年专访 - 张善友:.NET 技术是如何赋能并改变世界的
AVH Deployment Practice (1) | Deploying the Flying Paddle Model on Arm Virtual Hardware









