1. 从输出结果上,document.URL 和 windows.location.href 没有区别。
2. 非要说区别的话,你只可以读取document.URL的值,不能修改它。windows.location.href的值你即可以读取也可以修改。
3. windows.location.href是旧的写法,新的标准推荐用document.URL替代。(如果你只是读取的话)

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

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

    实际上,document 和 windows 这两个对象的区别已经包含了这个问题的答案. document 表示的是一个文档对象,windows 表示一个窗口对象.  一个窗口下面可以有很多的docu ...

  2. JS 中document.URL 和 window.location.href 的区别

    实际上,document 和 window 这两个对象的区别已经包含了这个问题的答案. document 表示的是一个文档对象,window 表示一个窗口对象. 一个窗口下面可以有很多的documen ...

  3. document.URL vs window.location.href All In One

    document.URL vs window.location.href All In One document.URL 与 window.location.href 两者有啥区别 document. ...

  4. js实现网页防止被iframe框架嵌套及几种location.href的区别

    首先我们了解一下几种location.href的区别简单的说:几种location.href的区别js实现网页被iframe框架功能,感兴趣的朋友可以了解下 首先我们了解一下:window.locat ...

  5. JS中 window.location 与window.location.href的区别

    疑惑:window.location='url'  与window.lcoation.href='url'效果一样,都会跳转到新页面,区别在哪?查得的资料如下: 1:window.location是页 ...

  6. response.redirect 与location.href 的区别

    最近做项目时发现,先弹出提示框,再跳转页面 这样写:Jscript.Alert("你好,Hello!"); Response.Redirect("/index.aspx& ...

  7. 【JavaScript】获取当前页的URL与window.location.href

    原文:http://blog.csdn.net/yongh701/article/details/45688743 版权声明:本文为博主原创文章,未经博主允许欢迎乱转载,标好作者就可以了!感谢欣赏!觉 ...

  8. window.location.replace和window.location.href的区别

    简单说说:有3个jsp页面(1.jsp,  2.jsp,  3.jsp). 进系统默认的是1.jsp ,当我进入2.jsp的时候, 2.jsp里面用window.location.replace(&q ...

  9. url 、src 、href 的区别

    url.href.src 详解 现自己居然没把url.href.src关系及使用搞清楚,今天就理一下.主要包括:url.src.href定义以及使用区别. URL(Uniform Resource L ...

随机推荐

  1. CF1096G Lucky Tickets 快速幂套FFT

    \(\color{#0066ff}{ 题目描述 }\) 一个\(n\)位数,每位可以是给出的\(k\)个数码中的一个数,可以有前导\(0\),输出前\(n/2\)位之和与后\(n/2\)位之和相等的方 ...

  2. 一些优秀的Firefox扩展

    AdBlock Plus 拦截广告. 在对付CSDN等垃圾网站时非常有用. Block Site 拦截你不想看的网站 没有知乎的一天真好... XStyle 设置自己喜欢的CSS样式(表示自己并不会用 ...

  3. c#静态变量赋值问题

    class Program { static int i = getNum(); int j = getNum(); ; static int getNum() { return num; } sta ...

  4. k8s安装

    docker pull mirrorgooglecontainers/kube-scheduler:v1.13.3 安装docker 使用阿里的源https://mirrors.aliyun.com/ ...

  5. Qt 学习之路 2(16):深入 Qt5 信号槽新语法

    Qt 学习之路 2(16):深入 Qt5 信号槽新语法  豆子  2012年9月19日  Qt 学习之路 2  53条评论 在前面的章节(信号槽和自定义信号槽)中,我们详细介绍了有关 Qt 5 的信号 ...

  6. keras调用预训练模型分类

    在网上看到一篇博客,地址https://www.pyimagesearch.com/2017/03/20/imagenet-vggnet-resnet-inception-xception-keras ...

  7. 【Cracking the Code Interview(5th edition)】二、链表(C++)

    链表结点类型定义: class Node { public: ; Node *next = nullptr; Node(int d) { data = d; } }; 快行指针(runner)技巧: ...

  8. Number Sequence (KMP第一次出现位置)

    Given two sequences of numbers : a[1], a[2], ...... , a[N], and b[1], b[2], ...... , b[M] (1 <= M ...

  9. html一些常用的符号

    <    :    < >    :    > &    :    & "     :    " @   :    © ®    :     ...

  10. day_09 函数及参数

    1.定义:把功能封装起来,方便下次直接调用 2.语法:def 关键词开头,空格之后接函数名称和圆括号(). def 函数名(形参) 函数体 3.参数:圆括号用来接收参数.若传入多个参数,参数之间用逗号 ...