窗口对象的位置属性与文档对象的位置属性之间有什么区别吗?
window.location || document.location // That is the question.发布于 2013-02-26 07:51:17
这两个对象是相同的:
console.log(window.location === document.location) // true它们都是指位置对象。
发布于 2013-02-26 07:56:09
window.location represent position in current view of page in browser windowdocument.location表示当前显示完整文档/页的位置
例如,在http://www.nationalgeographic.com/中,直到每日新闻部分是window,整页向下滚动直到结束是document
https://stackoverflow.com/questions/15083972
复制相似问题