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() {}
}
JS/jQuery
最新推荐文章于 2023-08-07 15:48:17 发布