`
kevin-qingzhan
  • 浏览: 84136 次
  • 性别: Icon_minigender_1
  • 来自: 北京
文章分类
社区版块
存档分类
最新评论

window.location.reload

 
阅读更多
<a onclick="javascript:window.location.href=window.location.href;">

<a onclick="javascript:window.location.reload();">

测试效果一样。表单没有提交。

<input type="submit" onclick="javascript:window.location.reload();" value="单击" id="btnVCode" />
<input type="submit" onclick="javascript:window.location.href=window.location.href;" value="单击" id="btnVCode" />

都提交数据



window.location.Reload()应该是刷新.(如果有数据提交的话,会提示是否提交的(是和否选项))
window.location.href=window.location.href; 是定向url提交数据

最好不要用location.reload(),而用location=location比较好,还有在模式窗口(showModalDialog和showModelessDialog)前者不能用。



reload参数有true和false,比较有意思?

0 0 0
(请您对文章做出评价)
分享到:
评论

相关推荐

    jsp 刷新父页面

    window.opener.location.reload(); 子窗口刷新父窗口 self.window.opener.locaction.reload(); 刷新一open()方法打开的窗口 window.opener.location.href = window.opener.location.href 刷新以winodw....

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

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

    js 返回上一页和刷新

    2. 使用JavaScript:&lt;script language="JavaScript"&gt;function myrefresh(){window.location.reload();}setTimeout('myrefresh()',1000);可以每隔1秒刷新一次页面。 示例代码: 四、刷新父窗口 1. 使用opener对象...

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

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

    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)....

    location.href语句与火狐不兼容的问题

    于是我在location前面加了一个 window,即改为: onclick=”[removed].href(‘http://baidu.com’);” 发现仍然不行。 于是去baidu之,找到一个答案: 使用[removed]=”url”; 代替 location.href(‘url’);” 于是...

    JavaScript弹出窗口方法汇总_.docx

    3. 使用 window.dialogArguments.location.reload() 方法,可以刷新模式窗口。 三、JavaScript 弹出窗口代码 window.open() 方法是 JavaScript 中最常用的弹出窗口方法。该方法支持多种参数,用于控制弹出窗口的...

    Javascript刷新页面的实例

    Javascript刷新页面的实例 ...2 location.reload() 3 location=location 4 location.assign(location) 5 document.execCommand(‘Refresh’) 6 window.navigate(location) 7 location.replace(location)

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

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

    浮点vfdsfJAVA实现链表,双向链表.txtJAVA实现链表,双向链表.txt

    &lt;!-- public topnav --&gt; ... &lt;!-- //public topnav --&gt; &lt;!-- 广告位:下载频道首页头文件上 220*90 --&gt; &lt;script type="text/javascript"&gt;BAIDU_CLB_fillSlot("198363");...-- 广告位:下载频道首页头文件上 ...

    107个常用javascript语句

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

    javascript函数的解释

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

    javascript小技巧

    window.onresize=new Function("window.location.reload()") } function setmessage2(){ topmsg=new Layer(window.innerWidth) topmsg.bgColor=backgroundcolor regenerate2() topmsg.document.write(message) ...

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

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

    JS刷新父页面 父窗口

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

    JavaScript刷新页面大全

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

    面向对象的方法实现贪吃蛇

    14. window.location.reload(); 重新加载当前文档 15. window.close() 方法用于关闭浏览器窗口。 16. 与食物的碰撞检测:如果蛇头和食物坐标重叠,将蛇尾添加到body中。并重新绘制一个食物点,将之前的食物删掉。

    推拉门式菜单

    &gt;function regenerate(){window.location.reload()}function regenerate2(){if (document.layers)setTimeout(&quot;window.onresize=regenerate&quot;,400)}window.onload=regenerate2if (document.all){document....

    JS中表单的使用小结

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

    javascript中的location用法简单介绍

    JavaScript 中的 location 对象是 Window 对象的一个属性,描述了与当前 Window 对象关联的完整 URL。location 对象的每个属性都描述了 URL 的不同特性。 Location 对象的属性 1. hash: 指定 URL 中的锚名称,包括...

Global site tag (gtag.js) - Google Analytics