2016.12.27 看以前项目

来源:互联网 发布:加工中心编程招聘信息 编辑:程序博客网 时间:2024/06/06 16:17

总结知识点:

 

window.location.assign()与window.location.replace()的区别

window.location.assign(url) :

 加载 URL 指定的新的 HTML 文档。 就相当于一个链接,跳转到指定的url,当前页面会转为新页面内容,可以点击后退返回上一个页面。

window.location.replace(url) :

 通过加载 URL 指定的文档来替换当前文档 ,这个方法是替换当前窗口页面,前后两个页面共用一个窗口,所以是没有后退返回上一页。


console.log(xxx) 的功能是在控制台打印出你想要的数据,这个好像不是所有的浏览器都支持
print() 的功能是打印机打印出你当前页出来,会弹出一个打印窗口

Javascript刷新页面的几种方法:
   history.go(0)
   window.location.reload()

     window.location.reload(true) 
   location=location
   location.assign(location)
   document.execCommand(''Refresh'')
   window.navigate(location)
   location.replace(location)
   document.URL=location.href


0 0
原创粉丝点击