当前位置:网站首页>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
边栏推荐
猜你喜欢

How useful is four-quadrant time management?

基于ABP实现DDD

leetcode303场周赛复盘

Synchronized and volatile interview brief summary

WPF project - basic usage of controls entry, you must know XAML

定时器的类型

WeChat chat record search in a red envelope

Qt实战案例(54)——利用QPixmap设计图片透明度

Tencent Cloud Deployment----DevOps

Internet banking stolen?This article tells you how to use online banking safely
随机推荐
三、数组
01 Encounter typescript, build environment
t-sne 数据可视化网络中的部分参数+
复制延迟案例(1)-最终一致性
R language ggplot2 visualization: use the ggboxplot function of the ggpubr package to visualize the box plot, use the font function to customize the font size, color, style (bold, italic) of the legen
Implement anti-shake and throttling functions
Doing things software development - the importance of law and understanding of reasonable conclusions
Codeforces Round #796 (Div. 2)(A-D)
The R language ggstatsplot package ggbarstats function visualizes bar charts, and adds hypothesis test results (including sample number, statistics, effect size and its confidence interval, significan
腾讯云部署----DevOps
DBeaver连接MySQL 8.x时Public Key Retrieval is not allowed 错误解决
「秋招系列」MySQL面试核心25问(附答案)
Snake Project (Simple)
网银被盗?这篇文章告诉你如何安全使用网银
Why is the field of hacking almost filled with boys?
After Grafana is installed, the web opens and reports an error
C语言”三子棋“升级版(模式选择+AI下棋)
"Autumn Recruitment Series" MySQL Interview Core 25 Questions (with answers)
radiobutton的使用
The use of border controls