下面的例子 好像 给 loadScript 加不加onload影响不大
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "
http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="
http://www.w3.org/1999/xhtml">
<head id="head">
<meta http-equiv="Content-Type" content="text/html" charset=gb2312 />
<title>qqq</title>
<meta name="keywords" content="qq" />
<meta name="description" content="qqq" />
<link href="/templets/default/style/indexallqqq.css" rel="stylesheet" type="text/css" />
</head>
<body>
<!--[if IE 6]>
<SCRIPT type=text/javascript src="/templets/default/js/DD_belatedPNG.js" ></SCRIPT>
<script type="text/javascript" src="/templets/default/js/ie6.js" ></script>
<![endif]-->
<!-- szfzxx.com Baidu tongji analytics -->
<script type="text/javascript">
var _bdhmProtocol = (("https:" == document.location.protocol) ? " https://" : " http://");
document.write(unescape("%3Cscript src='" + _bdhmProtocol + "hm.baidu.com/h.js%3F4b9c3ea9a4620fb0c12c72def9bf649f' type='text/javascript'%3E%3C/script%3E"));
</script>
<script src="
http://s19.cnzz.com/stat.php?id=4869877&web_id=4869877&show=pic" language="Javascript"></script>
<script type="text/javascript" charset="utf-8" src="
http://gate.looyu.com/50931/111105.js"></script>
<script type="text/javascript">
function loadScript(url, callback) {
var script = document.createElement("script");
script.type = "text/javascript";
//IE
if (script.readyState) {
script.onreadystatechange = function () {
if (script.readyState == "loaded" || script.readyState == "complete") {
script.onreadystatechange = null;
callback();
}
}
} else {
//非IE
script.onload = function () {
callback();
}
}
script.src = url;
document.getElementById("head").appendChild(script);
}
//第一步加载jquery类库
loadScript("/templets/default/js/jquery-1.4.4.min.js", function () {
//第二步加载hello.js
loadScript("/templets/default/js/otherall.js", function () {
//第三步加载world.js
loadScript("
http://gate.looyu.com/50931/111105.js", function () {
});
});
});
</script>
</body>
</html>