JavaScript之BOM操作

BOM :浏览器对象模型
可以通过全局对象window来访问

	window.document  // 当前页面的文档(源码)
	window.frames  // 框架集合
	window.navigator  // 浏览器及其功能信息
	window.screen // 屏幕信息
	window.location
	window.history // 历史信息
	window.close()  // 关闭页面
    window.open('url',"blank","style") //打开一个新页面,是否在新窗口打开,blank为true,则是在新窗口打开,style为样式

window.location

 	window.location.href = ''// 跳转页面
    window.location.reload()  // 刷新页面
    window.location.reload(true)// 带缓存刷新
    window.location.replace()  // 跳转页面不留痕迹
    window.location.assign()  // 跳转页面留痕迹

window.history

	window.history.back()  // 跳转到前一页
    window.history.forward()  // 跳转到后一页
    window.history.back() // 上一页
    window.history.go()  // 大于0时,跳转到自己后面的页面。小于0时,跳转到前面的页面
發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章