参考:1.http://www.javascriptkit.com/jsref/location.shtml
2.http://www.highdots.com/forums/javascript-discussion-multi-lingual/window-location-window-location-href-276539.html
写道
Location contains information about the current URL of the browser. The most common usage of Location is simply to use it to automatically navigate the user to another page:
<script type="text/javascript">
window.location="http://www.google.com"
</script>
所以推荐使用window.location,包含更多信息
理由(参考文章的第二篇)
写道
Although "window.location.href" also seems to work. The "entire URL"
href property (of window.location) appears to be a bit redundant. Other
properties of "windows.location" could be useful for reading or changing
portions of the URL like domain/host names and port numbers (which are
sometimes not stated - permitted to remain the default).
--EOF--
分享到:
相关推荐
window.location.href页面跳转的用法(区别于redirect)
javascript 打开页面window.location和window.open的区别.docx
详解js location.href和window.open的几种用法和区别.docx
一、location.href常见的几种形式 self.location.href;//当前页面打开URL页面 [removed].href;//当前页面打开URL页面 this.location.href;//当前页面打开URL页面 location.href;// 当前页面打开URL页面 parent....
NULL 博文链接:https://hugang357.iteye.com/blog/1833003
“[removed].href”、”location.href”是本页面跳转 “parent.location.href”是上一层页面跳转 “top.location.href”是最外层的页面跳转 举例说明: 如果A,B,C,D都是jsp,D是C的iframe,C是B的iframe,B是A的...
window.opener.location.href = window.opener.location.href 刷新以winodw.showModelDialog()方法打开的窗口 window.parent.dialogArguments.document.execCommand('Refresh'); 或 Response.Write("<script>...
window.location.href location.search; //获取url中"?"符后的字串 document.referrer 获取来路的url,相当于php的$_SERVER['HTTP_REFERER']。 encodeURIComponent() 对url进行转定义,相当于php的urlencode()...
首先我们了解一下:[removed].href、location.href、self.location.href、parent.location.href、top.location.href他们的区别与联系,简单的说:几种location.href的区别 js实现网页被iframe框架功能 “[removed]....
document 表示的是一个文档对象,windows ...windows.location.href); 发现,这两个的值不一样, document.URL : //www.jb51.net/ windows.location.href ://www.jb51.net/#server 所以,如果要用 fragment 进行
JavaScript_window.setTimeout()_的详细用法
Javascript窗口与提示大全 ...onclick="javaScript:window.location.href='http://angelialily.javaeye.com/';"/> //-----------关闭按钮----------// 关闭" onclick="javaScript:window.close();">
使用[removed].reload;...window.opener.location.href=window.opener.location.href; window.opener.location.reload(); 这种写法就不出现那讨厌的对话框啦! 介绍JS实现刷新iframe的方法 <iframe src=”1.ht
今天总结一下js中几个对象的区别和用法: 首先来说说 parent.window与top.window的用法 “[removed].href”、”location.href”是本页面跳转 “parent.location.href”是上一层页面跳转 “top.location.href”是最...
input type=”button” value=”添加” onclick=”location.href(‘//www.jb51.net);” /> 测试的时候发现其在IE下是可以用的而firefox则不能使用了。... 代替 location.href(‘url’);” 于是将源程序改为
代码如下: //打开新页面并利用post方式传递参数 function openNewPageWithPostData(postAddress,opentype,paramNames,paramValues) { var newWindow = window.open(postAddress,opentype); if (!newWindow) { return...
window.location.href='index.jsp';</script>"); ◆弹出对话框后在父窗体打开文件index.jsp out.println("<script language='javascript'>alert('弹出内容!');window.parent.location.href='index.jsp';</script>...
//alert(window.top.location == self.location); if (window.top.location != self.location) { window.top.tb_show(t, a, g); } else { self.tb_show(t, a, g); } this.blur(); return false; }); }