JS/jQuery

1、window对象表示浏览器创建的窗口
window对象可以省略
window.alert() == alert()
2、document对象是window对象的一部分
浏览器的html文档成为document对象
windows.document.body()
3、
window.location = document.location
=location.href()
if (!window.console || !console.firebug){
    var names = [“log”, “debug”, “info”, “warn”, “error”, “assert”, “dir”, “dirxml”, “group”, “groupEnd”, “time”, “timeEnd”, “count”, “trace”, “profile”, “profileEnd”];
    window.console = {};
    for (var i = 0; i < names.length; ++i)
        window.console[names[i]] = function() {}
}

猜你喜欢

转载自blog.csdn.net/u011644858/article/details/84538835