1、document表示的是一个文档对象,window表示的是一个窗口对象,一个窗口下可以有多个文档对象。

  所以一个窗口下只有一个window.location.href,但是可能有多个document.URL、document.location.href

2、window.location.href和document.location.href可以被赋值,然后跳转到其它页面,document.URL只能读不能写

window.location.href和document.location.href、document.URL的区别的更多相关文章

  1. window.location.href 和 document.location.href

    document表示的是一个文档对象,window表示的是一个窗口对象,一个窗口下可以有多个文档对象. 所以一个窗口下只有一个window.location.href,但是可能有多个document. ...

  2. window.location和window.location.href和document.location的关系

    1,首先来区分window.location和window.location.href. window.location.href是一个字符串. 而window.location是一个对象,包含属性有 ...

  3. document.location.reload();与location.href='xxx'的区别

    document.location.reload();会重新加载页面,onload事件会被触发. location.href='xxx'刷新页面,onload事件不会触发.

  4. Document.location.href和.replace的区别

    转自:https://www.cnblogs.com/GT_Andy/archive/2007/10/31/1922138.html 1 Document.location.href和.replace ...

  5. js中的 window.location、document.location、document.URL 对像的区别(转载)

    原文:http://www.cr173.com/html/18417_1.html 当我们需要对html网页进行转向的时候或是读取当前网页的时候可以用到下面三个对像: window.location. ...

  6. window.location和document.location的区别分析

    用户不能改变document.location(因为这是当前显示文档的位置).但是,可以改变window.location (用其它文档取代当前文档)window.location本身也是一个对象,而 ...

  7. document.location window.location

    document.location 和 window.location 取url的值的时候可以通用,但是 document是window的属性,所以不能直接用document.location =ur ...

  8. ☀【document / location】

    <!DOCTYPE html> <html lang="zh-CN"> <head> <meta charset="utf-8& ...

  9. document.location的属性

    示例html完整路径为: http://10.10.3.117:8500/html/ypt/index.html alert("document.location.href:"+d ...

随机推荐

  1. ContikiMAC RDC协议

    http://www.mamicode.com/info-detail-1348767.html

  2. iOS开发中的错误整理,导航控制器的导航栏取消系统渲染的错误

  3. Aria2 懒人安装教程

    https://aria2.github.io/ uI版:https://github.com/ziahamza/webui-aria2 web的 可以在线使用的 https://ziahamza.g ...

  4. php BC高精确度函数库

    #两个高精度数比较 #int bccomp ( string $left_operand , string $right_operand [, int $scale ] ) #$left=$right ...

  5. 支付宝前端开源框架Alice(解决各个浏览器的样式不一致的问题)

    /**************** 网址:https://github.com/sofish/Alice /******************       @charset "utf-8& ...

  6. .net提供的5种request-response方法一

    .net提供了三种基本方法和两种底层方法来发送http请求和接收http响应,通过这些方法,我们可以模仿在浏览器地址栏输入URL地址访问网页的方法.我们发送http请求,接收服务器返回的响应(通常就是 ...

  7. jquery json解析详解

    我们先以解析上例中的comments对象的JSON数据为例,然后再小结jQuery中解析JSON数据的方法. JSON数据如下,是一个嵌套JSON: 1 {"comments":[ ...

  8. MapReduce初探

    转自 :http://blog.itpub.net/28912557/viewspace-1127423/ Map-Reduce处理过程(分析气象数据的map-reduce过程)1,调用标准的inpu ...

  9. Linux基础知识之man手册的使用

    在Linux中man的使用频率应该是很高的,灵活运用它可以让自己快速的掌握一个不熟悉命令的使用方法.下面来介绍下man 环境CentOS6.8 man - format and display the ...

  10. Bash 脚本 getopts为什么最后一个參数取不到

    看以下的Bash脚本: #!/bin/bash interval=0 count=0 pid="" while getopts "p:d:n" arg do c ...