javascript的事件加载
[08-08 00:41:47] 来源:http://www.xuehuiba.com Javascript教程 阅读:8342次
概要:22. return document.getElementById(id); 23. } 24. JS.$ = $; 25.})()<!doctype html><html dir="ltr" lang="zh-CN"> <head> <meta charset="utf-8"/> <meta http-equiv="X-UA-Compatible" content="IE=Edge"> <title>闭包环境中的事件加载</title> <script type="text/javascript"> (function(){ if(!window.JS){ window['JS'] = {} }
javascript的事件加载,标签:javascript视频教程,javascript教程下载,http://www.xuehuiba.com
22.
return document.getElementById(id);
23.
}
24.
JS.$ = $;
25.})()<!doctype html>
<html dir="ltr" lang="zh-CN">
<head>
<meta charset="utf-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=Edge">
<title>闭包环境中的事件加载</title>
<script type="text/javascript">
(function(){
if(!window.JS){
window['JS'] = {}
}
var onReady = function(loadEvent) {
if(!+"v1"){
(function(){
try {
document.documentElement.doScroll("left");
} catch(e) {
setTimeout( arguments.callee, 0 );
return;
}
loadEvent();
})();
}else{
document.addEventListener( "DOMContentLoaded", loadEvent, false );
}
}
JS.onReady = onReady;
var $ = function(id){
return document.getElementById(id);
}
JS.$ = $;
})()
22.
return document.getElementById(id);
23.
}
24.
JS.$ = $;
25.})()<!doctype html>
<html dir="ltr" lang="zh-CN">
<head>
<meta charset="utf-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=Edge">
<title>闭包环境中的事件加载</title>
<script type="text/javascript">
(function(){
if(!window.JS){
window['JS'] = {}
}
var onReady = function(loadEvent) {
if(!+"v1"){
(function(){
try {
document.documentElement.doScroll("left");
} catch(e) {
setTimeout( arguments.callee, 0 );
return;
}
loadEvent();
})();
}else{
document.addEventListener( "DOMContentLoaded", loadEvent, false );
}
}
JS.onReady = onReady;
var $ = function(id){
return document.getElementById(id);
}
JS.$ = $;
})()
JS.onReady(function(){
alert(JS.$("test").innerHTML)
});
JS.onReady(function(){
alert("dddddddddddddddd")
});
</script>
</head>
<body>
<p id="test">Test</p>
</body>
</html>
运行代码
Tag:Javascript教程,javascript视频教程,javascript教程下载,电脑知识学习 - 网页制作 - Javascript教程
最新更新