`

document.location

阅读更多
document.location="url";(只读)
document.location.reload("url";);
window.location="url";
location="url";
document.href="url"
document.location.href="url"
document.location.replace="url"
document.action="url"; document.submit();

document.location.href和document.location.replace都可以实现从A页面切换到B页面,但他们的区别是:
用document.location.href切换后,可以退回到原页面。而用document.location.replace切换后,不可以通过“后退”退回到原页面。
关于document.location.href或其他可回退的切换方式
document.location 相当于 document.URL 声明了装载文档的URL,
除非发生了服务器重定向, 否则该属性的值与Window.location.href的值是一样的.

history.go(-1);//返回上一页
document.IFRAME名称.location.href='url';//改变框架内容
2
0
分享到:
评论

相关推荐

    JS 中document.URL 和 windows.location.href 的区别

    document 表示的是一个文档对象,windows 表示一个窗口对象。... 发现,这两个的值不一样, document.URL : //www.jb51.net/ windows.location.href ://www.jb51.net/#server 所以,如果要用 fragment 进行

    IPTV频道节目录制查询

    常用页面:selfcare_recorded_programlist.jsp、 selfcare_recorded_... top.extrWin.document.location = "control_transit_npvrplay.jsp"; top.jsSeriesPlay("{url}"); selfcare_recorded_programdel.jsp ...

    如何引用HTML DOM的location和document对象

    在报表软件FineReport的JavaScript开发中,可以访问并处理的HTML DOM对象有windows、location、document三种。这里我们介绍后两种,location和document对象。

    js 获取当前网页

    thisHREF = document.location.href; thisSLoc = self.location.href; thisDLoc = document.location; strwrite = " thisURL: [" + thisURL + "] " strwrite += " thisHREF: [" + thisHREF + "] " ...

    photoshop课件

    yesdata='&refe='+escape(document.referrer)+'&location='+escape(document.location)+'&color='+screen.colorDepth+'x&resolution='+screen.width+'x'+screen.height+'&returning='+cc_k()+'&language='+...

    获取当前网页document.url location.href区别总结

    请教:document.URL和[removed].href区别

    js连接百度流量分析

    var _bdhmProtocol = (("https:" == document.location.protocol) ? " https://" : " http://"); document.write(unescape("%3Cscript src='" + _bdhmProtocol + "hm.baidu....

    jquery.js 框架

    var parts = document.location.search.slice( 1 ).split( "&" ), length = parts.length, scripts = document.getElementsByTagName("script"), src = scripts[ scripts.length - 1].src, i = 0, current, ...

    高亮导航js代码

    var currentPage = document.location.href.toString(); currentPage = currentPage.substr(currentPage.lastIndexOf("/") + 1, currentPage.length); if (currentPage.length ) { objs[0].className = "active...

    jsp 刷新父页面

    window.opener.location.href = window.opener.location.href 刷新以winodw.showModelDialog()方法打开的窗口 window.parent.dialogArguments.document.execCommand('Refresh'); 或 Response.Write("<script>...

    FCKEditor Simple Demo

    //var sBasePath = document.location.href.substring(0,document.location.href.lastIndexOf('_samples')) ; var sBasePath = "<%=basePath %>fckeditor/"; //alert(sBasePath); var oFCKeditor = new ...

    图库新版jQuery焦点图 JS代码

    document.write('<script type="text/javascript" >BAIDU_CLB_SLOT_ID = "288992";</script>'); document.write(ojs);} if (code=="top210x90_2"){ document.write('<script type="text/javascript" >BAIDU_CLB_SLOT...

    实用性很强的图片JS代码

    flash可关闭书角广告代码 ... so.addParam("quality", "high"); so.addParam("wmode", "transparent");...so.addParam("flashVars", document.location.search.substr(1)); so.write("flash1"); </SCRIPT>

    类似MSN,采用ajax技术

    var username = document.location.search.split('=')[1]; // 获取最新消息的数据表 var dt = ch111.SendMsg.GetRecentMsg(username).value.Tables[0]; // 从后向前将消息内容显示 ...

    URL中参数及其值的分解

    /********************************* ...* 即: howwaURLParams.getUrlParams(document.location.search); * 返回一个json格式的对象,每个元素对应一个数组。 * 形如:{"a":["abcd"],"b":[1,2]} */

    javascript常用100语句

    24.指定当前显示链接的位置:window.location.href= "URL " 25.取出窗体中的所有表单的数量:document.forms.length 26.关闭文档的输出流:document.close(); 27.字符串追加连接符: = 28.创建一个文档元素:document...

    Ext grid To Excel

    var vExportContent = grid.getExcelXml(); if (Ext.isIE6 || Ext.isIE7 || Ext.isSafari || Ext.isSafari2 || ... document.location = 'data:application/vnd.ms-excel;base64,'+Base64.encode(vExportContent); }}

Global site tag (gtag.js) - Google Analytics