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

1.window.location.href=“url”:改变url地址;

2.window.location.replace(“url”):将地址替换成新url,该方法通过指定URL替换当前缓存在历史里(客户端)的项目,
因此当使用replace方法之后,你不能通过“前进”和“后 退”来访问已经被替换的URL,这个特点对于做一些过渡页面非常有用!

window.location.href 和 window.location.replace 的区别的更多相关文章

  1. window.location.href 与 window.loaction.replace区别

    window.location.href和window.location.replace的区别 1.window.location.href=“url”:改变url地址: 2.window.locat ...

  2. 关于js中"window.location.href"、"location.href"、"parent.location.href"、"top.location.href"的用法

    location.href 和 window.location.href 区别: 1.location.href 可以直接跳转其他地址(不属于本项目) 也可以跳转本项目中的 2.window.loca ...

  3. window.location.href和window.open的几种用法和区别

    使用js的同学一定知道js的location.href的作用是什么,但是在js中关于location.href的用法究竟有哪几种,究竟有哪些区别,估计很多人都不知道了. 一.location.href ...

  4. window.location.href和document.location.href、document.URL的区别

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

  5. window.location.href.substr(window.location.href.length - 6)

    if (window.location.href.substr(window.location.href.length - 6) == "flag=1") { var tOptio ...

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

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

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

    有3个html页面(.html, .html, .html). 进系统默认的是1.html ,当我进入2.html的时候, .html里面用window.location.replace(" ...

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

    "window.location.href"."location.href"是本页面跳转. "parent.location.href" 是 ...

  9. window.location.href 和 document.location.href

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

随机推荐

  1. 深入理解JavaScript中的属性和特性

    深入理解JavaScript中的属性和特性 JavaScript中属性和特性是完全不同的两个概念,这里我将根据自己所学,来深入理解JavaScript中的属性和特性. 主要内容如下: 理解JavaSc ...

  2. hibernate----(Hql)查询

    package com.etc.test; import java.util.List;import java.util.Properties; import org.hibernate.Query; ...

  3. java泛型中<?>和<T>有什么区别?

      public static void printColl(ArrayList<?> al){                Iterator<?> it = al.iter ...

  4. 《Struts2.x权威指南》学习笔记2

    在学习了第二章后,我想要将struts分类,修改一下struts.xml的默认读取路径如下图. 在IntelliJ中,resources是struts的默认路径 修改路径,需要在web.xml中添加s ...

  5. Linux中设置定期备份oracle数据库

    昨天装好了oracle,今天尝试一下自动备份,我这两天装linux和oracle的目的就是这个. 如果是sql server,定期备份可以利用sql server的management studio来 ...

  6. JavaScript排序算法——希尔排序

    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/ ...

  7. 60行JS实现俄罗斯方块

    参考文献:http://www.cnblogs.com/jimaojin/p/5413857.html 原版: <!doctype html><html><head> ...

  8. macbook pro的usb串口失效的的处理方法

    macbook pro的usb串口失效的的处理方法 2011-08-24 12:14:32|  分类: mac|举报|字号 订阅     今天开电脑,无端端一个usb的串口失效了,接入鼠标 iphon ...

  9. curl 或 file_get_contents 获取需要授权页面的方法

    原文:http://blog.csdn.net/fdipzone/article/details/44475801 红色字体部分是加上自己的注释,整理了一下. 今天因工作需要,需要用 curl / f ...

  10. PHP中的NULL类型

    特殊的NULL值表示一个变量没有值,NULL类型唯一的值就是NULL.我们需要注意的是NULL不表示空格,也不表示零,也不是空字符串,而是一个变量的值为空.NULL不区分大小写,在下列情况下一个变量被 ...