页面用window.open新开过窗口后,history.back()不保留信息 比如注册页面,填入信息不正确是报错并返回注册页面,我用的history.back(),如果注册页面没有新开窗口时是会保留之前填入的数据的(password之类的不算),但是如果注册页面如果有新开窗口,比如上传图片时会新开上传图片窗口,history.back()就不能保留之前的信息,好像刷新了一样,用history.go(-1)之类的都不行。在网上也搜索过了,有人遇到过,但没人解决 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 将表单递交到隐藏的iframe中,主页面是不变的,就不需要考虑返回问题了。至于返回的结果,无论错对,都从iframe的角度出发返回脚本提示或转址parent.location.replace("success.htm");脚本写在iframe返回页面的window.onload事件中。 表单提交到隐藏的iframe中的确实现了我要的效果,在页面提交的自然不用考虑返回问题了,厉害,都没想到过...只是后面这句"parent.location.replace("success.htm");脚本写在iframe返回页面的window.onload事件中。"不知道啥意思,请教... 通用的可以用cookie,IE下可以加个CSS:.saveHistory {behavior:url(#default#savehistory);} http://www.1netmedia.net/base/blogview.asp?logID=614 例子:主页面<form target="hf" action="b.htm">...</form><iframe name="hf" style="display:none;"></iframe>b.html中<script>window.onload=function(){ alert("递交成功"); parent.location.replace("success.htm");}</script> 纯JS实现年月日的三级联动 只要我的鼠标出现在右边,但还没有放到菜单上面,就弹出子菜单 js $(#form).submit失灵,求原因 正则判断 如果用iframe 调用带有top.location.href=self.location的网页? 帮忙看个JAVASCRIPT方法。 不懂JS, 一个很简单的问题请教 firefox下如何取得select的name值 弹出新窗口问题 找东西,RichTextBox和DOTNET中华网的DotNetTextBox,:(~ 事件触发 如何捕获链接的点击?
至于返回的结果,无论错对,都从iframe的角度出发返回脚本提示或转址
parent.location.replace("success.htm");
脚本写在iframe返回页面的window.onload事件中。
只是后面这句"parent.location.replace("success.htm");脚本写在iframe返回页面的window.onload事件中。"不知道啥意思,请教...
http://www.1netmedia.net/base/blogview.asp?logID=614
主页面
<form target="hf" action="b.htm">
...
</form>
<iframe name="hf" style="display:none;"></iframe>b.html中
<script>
window.onload=function(){
alert("递交成功");
parent.location.replace("success.htm");
}
</script>