`
aiyan2001
  • 浏览: 71734 次
  • 性别: Icon_minigender_1
  • 来自: 上海
社区版块
存档分类
最新评论

window.location.reload;刷新时

 
阅读更多

使用window.location.reload;刷新时,如果提交数据的动作,则会出现讨厌的对话框!


解决此问题,应该这样写:
window.location.href=window.location.href;
window.location.reload;
同理,如果是刷新父窗口,应该这样写:
window.opener.location.href=window.opener.location.href;
window.opener.location.reload();
这种写法就不出现那讨厌的对话框啦!

分享到:
评论
1 楼 yuyue618 2009-10-12  
如果是form提交的页面 如果这么做.  form提交过来的数据还会存在吗

相关推荐

    jsp 刷新父页面

    刷新本页Response.Write("<script>window.location.href=window.location.href; </script>"); 刷新父页和本页面: Response.Write("<script>alert('提交成功!');window.location.href=window.location.href;window....

    [removed].reload 刷新使用分析(去对话框)

    使用[removed].reload;刷新时,如果提交数据的动作,则会出现讨厌的对话框!...window.opener.location.reload(); 这种写法就不出现那讨厌的对话框啦! 介绍JS实现刷新iframe的方法 <iframe src=”1.ht

    JS刷新框架外页面七种实现代码

    window.parent.frames[1].location.reload(); 语句2. window.parent.frames.bottom.location.reload(); 语句3. window.parent.frames[“bottom”].location.reload(); 语句4. window.parent.frames.item(1)....

    关闭时刷新父窗口两种方法

    window.opener.location.reload()刷新父窗口window.opener.location.reload() 与 window.opener.location.href=window.opener.location.href 都是弹出窗口关闭时用来刷新父窗口。 但[removed].Reload 如果有数据提交...

    JS刷新父页面 父窗口

    // 刷新父页面。此段代码放在被弹出的页面 function refreshOpener() { var win = top.window; try { if (win.opener) win.opener.location.reload();//或parent.location.reload(); } catch (ex) { } } .......

    window.open的页面如何刷新(父页面)上层页面

    代码如下: this.ClientScript.RegisterStartupScript(this.GetType(), this.Title, “window.opener.location.reload();alert(‘销帐成功!’);”, true); 主要是这段js代码:window.opener.location.reload...

    Javascript刷新页面的实例

    软件开发网整理的关于JS刷新...2 location.reload() 3 location=location 4 location.assign(location) 5 document.execCommand(‘Refresh’) 6 window.navigate(location) 7 location.replace(location)

    JS窗口大全----很全的哦

    //-----------按钮提示框----------// ...window.opener.location.reload();window.close()">返回</a> javaScript:window.location.reload();//返回当前页并刷新 。。。。。。。。。。。。。。。。。。。。

    layer 刷新某个页面的实现方法

    window.parent.location.reload()//刷新父页面 var index = parent.layer.getFrameIndex(window.name)//获取窗口索引 parent.layer.close(index) 1:刷新父页面 2:关闭此页面 2.1 获取窗口索引 (parent.window....

    JS中表单的使用小结

    使用window.open()弹出的弹出窗口,刷新父窗口 window.opener.location.reload() 使用window.showDialog弹出的模式窗口 window.dialogArguments.location.reload(); 2.javascript弹出窗口的两种实现方式 —下面给...

    刷新页面的几种方法小结(JS,ASP.NET)

    location.reload() 3. location=location 4. location.assign(location) 5. document.execCommand(‘Refresh’) 6. window.navigate(location) 7. location.replace(location) 8. document.URL=location.href 自动...

    子窗体与父窗体传值示例js代码

    //获取父页面 //parent.location.reload(); //刷新父页面 if (parent != null && parent != “undefined”) { window.returnValue = value; //返回值 window.close(); //关闭子页面 } //window.opener.document....

    JavaScript刷新页面大全

    详细的介绍了JavaScript多种情况下脚本刷新页面的的方法,并有详细的代码示例。如:window.location.reload();

    JS中showModalDialog关闭子窗口刷新主窗口用法详解

    网上找了好长时间 大都是window.opener.location.reload(),等等 都不是我想要的 最后终于发现了一个 想知道的就往下看看吧 showModalDialog和showModelessDialog 一、showModalDialog和showModelessDialog有什么不同...

    JS实现刷新父页面不弹出提示框的方法

    本文实例讲述了JS实现刷新父页面不弹出提示框的方法。分享给大家供大家参考,具体如下: A页面 open方式出 B... window.opener.location.reload(); window.opener = null; window.open('','_self'); window.close

    107个常用javascript语句

    89.window.location.reload()刷新当前页面. 90.window.history.back()返回上一页,window.history.forward()返回下一页,window.history.go(返回第几页,也可以使用访问过的URL) 91.document.write()不换行的输出,...

    JS刷新父窗口的几种方式小结(推荐)

    浮层内嵌iframe及frame集合窗口,刷新父页面的多种方法 [removed] parent.location.reload(); [removed] [removed] ... window.opener.location.reload(); [removed] [removed] window.opener.location.

    javascript函数的解释

    89.window.location.reload()刷新当前页面. 89-1.parent.location.reload()刷新父亲对象(用于框架) 89-2.opener.location.reload()刷新父窗口对象(用于单开窗口) 89-3.top.location.reload()刷新最顶端对象...

    javascript 强制刷新页面的实现代码

    Javascript刷新页面的几种方法: 1 history.go(0) 2 location.reload() 3 location=location 4 location.assign(location) 5 document.execCommand(‘Refresh’) 6 window.navigate(location) 7 location.replace...

    javascript刷新父页面的各种方法汇总

    用iframe、弹出子页面刷新父页面iframe ...window.opener.location.reload(); [removed] 子窗口刷新父窗口 [removed] self.opener.location.reload(); [removed] 刷新以open()方法打开的窗口 [removed] win

Global site tag (gtag.js) - Google Analytics