?? ajax.js
字號:
//ajax函數
var http_request = false;
function send_request(url)
{
//初始化、指定處理函數、發送請求的函數
http_request = false;
//開始初始化XMLHttpRequest對象
if(window.XMLHttpRequest)
{
http_request = new XMLHttpRequest(); //Mozilla 瀏覽器
if (http_request.overrideMimeType)
{
http_request.overrideMimeType('text/xml'); //設置MiME類別
}
}
else if (window.ActiveXObject)
{
try{http_request = new ActiveXObject("Msxml2.XMLHTTP");} //IE瀏覽器
catch (e)
{
try {http_request = new ActiveXObject("Microsoft.XMLHTTP");}
catch (e) {}
}
}
if (!http_request)
{
window.alert("不能創建XMLHttpRequest對象實例."); //異常,創建對象實例失敗
return false;
}
http_request.open("GET",url,true); // 確定發送請求的方式和URL以及是否同步執行下段代碼
http_request.send(null);
}
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -