1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
|
function
addLoadEvent(func){
//不管在页面加载完毕执行多少个函数,都应付自如
var
oldonload = window.onload;
if
(
typeof
window.onload !=
'function'
){
window.onload = func;
}
else
{
window.onload =
function
(){
oldonload();
func();
}
}
}
function
getHTTPObject(){
if
(
typeof
XMLHttpRequest ==
"undefined"
)
XMLHttpRequest =
function
(){
try
{
return
new
ActiveXObject(
"Msxml2.XMLHTTP.6.0"
);}
catch
(e){}
try
{
return
new
ActiveXObject(
"Msxml2.XMLHTTP.3.0"
);}
catch
(e){}
try
{
return
new
ActiveXObject(
"Msxml2.XMLHTTP"
);}
……
|
也不知道是不是自己哪里敲错代码了,在火狐浏览器正常。
本文转自 小旭依然 51CTO博客,原文链接:http://blog.51cto.com/xuyran/1783398