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. 将string转换成char型的一般方法

    C++文件读取中: infile in: in.open("file.dat",ios::in); 这样是能够的. 可是 string a; a="file.dat&qu ...

  2. CSS(一):CSS简介和基本语法

    一.CSS简介 1.什么是CSS CSS:Cascading Style Sheet:即层叠样式表.样式定义了如何显示HTML或XHTML元素.包括对字体.颜色.边距.高度.宽度.背景图片.网页定位等 ...

  3. DataGridView使用技巧七:列顺序的调整、操作行头列头的标题

    一.列顺序的调整 设定DataGridView的AllowUserToOrderColumns为True的时候,用户可以自由调整列的顺序. 当用户改变列的顺序的时候,其本身的Index不好改变,但是D ...

  4. GDI+(一):GDI+ 绘图基础

    一.GDI+绘图基础 编写图形程序时需要使用GDI(Graphics Device Interface,图形设备接口),从程序设计的角度看,GDI包括两部分:一部分是GDI对象,另一部分是GDI函数. ...

  5. win7控制面板一打开就停止的解决方法

    现象:win7系统,打开控制面板后,弹出提示窗口:资源管理器停止工作,需要重启.点重启后,系统自动重建桌面进程.控制面板根本无法使用. 下面是网上找到的方法,如果都不行再参照后面我的解决方法. 1. ...

  6. stm32独立看门狗

    转载:http://blog.sina.com.cn/s/blog_7f1dc53b01010mqa.html 实验现象: 开始LED1亮,LED2熄灭,若不隔时间按KEY1则发现LED2因独立看门狗 ...

  7. node-webkit读取json文件

    1.原理 node-webkit包含了node.js,node.js提供了处理json数据文件的方法,通过node.js提供的方法,我们可以比较方便地读取json文件. 2.示例 这里我们读取的文件是 ...

  8. Storm快速理解

    转自:http://blog.csdn.net/colorant/article/details/8256039 更多云计算相关项目快速理解文档  http://blog.csdn.net/color ...

  9. selenium测试(Java)-- 键盘事件(七)

    1 package com.test.key; 2 3 import org.openqa.selenium.By; 4 import org.openqa.selenium.Keys; 5 impo ...

  10. C++ 中的空格

    C++ 中的空格只包含空格的行,被称为空白行,可能带有注释,C++ 编译器会完全忽略它. 在 C++ 中,空格用于描述空白符.制表符.换行符和注释.空格分隔语句的各个部分,让编译器能识别语句中的某个元 ...