当前位置:网站首页>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
边栏推荐
- 实现防抖与节流函数
- C language "the third is" upgrade (mode selection + AI chess)
- Ubantu专题4:xshell、xftp连接接虚拟机以及设置xshell复制粘贴快捷键
- 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
- Grafana安装后web打开报错
- After Grafana is installed, the web opens and reports an error
- JVM parameter analysis Xmx, Xms, Xmn, NewRatio, SurvivorRatio, PermSize, PrintGC "recommended collection"
- 定时器的类型
- vb中如何连接mysql_vb怎么连接数据库「建议收藏」
- Tencent Cloud Deployment----DevOps
猜你喜欢
随机推荐
7、常见面试口语提问问题汇总
R language moves time series data forward or backward (custom lag or lead period): use the lag function in the dplyr package to move the time series data forward by one day (set the parameter n to a p
四象限时间管理有多好用?
BGP综合实验(建立对等体、路由反射器、联邦、路由宣告及聚合)
复制延迟案例(1)-最终一致性
Implement anti-shake and throttling functions
Bilateral filtering acceleration "recommended collection"
border控件的使用
ML.NET相关资源整理
Applicable scenario of multi-master replication (2) - client and collaborative editing that require offline operation
Word table to Excel
MySQL基础篇【单行函数】
Internet banking stolen?This article tells you how to use online banking safely
ansible学习笔记02
Grafana安装后web打开报错
工程水文学试卷
Deployment application life cycle and Pod health check
Qt实战案例(54)——利用QPixmap设计图片透明度
做事软件开发-法的重要性所在以及合理结论的认识
为什么毕业季不要表白?