次のようにコードコードをコピーします。
var xmlhttp;
関数createxmlhttprequest()
{{
if(window.xmlhttprequest)
{{
xmlhttp = new xmlhttprequest();
if(xmlhttp.overridemimeType)
{{
xmlhttp.OverRidemimeType( "Text/xml");
}
}
else if(window.activexobject)
{{
試す
{{
xmlhttp = new ActiveXObject( "msxml2.xmlhttp");
}
キャッチ(e)
{{
xmlhttp = new ActiveXObject( "microsoft.xmlhttp");
}
}
if(!xmlhttp)
{{
window.alert( "ブラウザはxmlhttprequestオブジェクトの作成をサポートしていません");
}
xmlhttpを返します。
}