chromeÀïµÄajax, status=0??? - Web ¿ª·¢ / Ajax
ΪºÎXMLHttpRequestÔÚIEÏÂÕý³£ÔËÐУ¨readyState=4,status=200£©£¬
¿ÉÊÇchromeÀïµÄreadyStateÄÜ´ïµ½4£¬¶østatusһֱΪ0£¿
JScript code:
function getHttp() {
var xmlhttp = window.XMLHttpRequest ? new XMLHttpRequest() : new ActiveXObject("Microsoft.XMLHTTP")
if (xmlhttp == null) return;
try
{
alert("1");
xmlhttp.open("get", "http://www.baidu.com");
alert("2");
}
catch (e)
{
xmlhttp = null;
return;
}
alert("3");
xmlhttp.onreadystatechange = function()
{
if (!xmlhttp) return;
if (xmlhttp.readyState == 4)
{
alert("4");
if (xmlhttp.responseText)
{
alert("5");
alert(xmlhttp.responseText);
}
xmlhttp = null;
}
}
alert("6");
xmlhttp.send(null);
}
ajax ²»ÄÜ¿çÓòµÄ¡£
³ÌÐòÐè·ÅÔÚ·þÎñÆ÷¶ËÖ´ÐÐ ·ñÔò»á³öÏÖÕâÖÖÇé¿östatusΪ0
¶ò£¬Õâ²»ÊÇÖ÷ÒªÎÊÌâ¡¡
Ö÷ÒªÎÊÌâÊÇÔÚIEÀïÉÏÃæµÄ´úÂëÖ´ÐÐÕý³££¬ÔÚChromeÀïÈ´²»Äܵõ½Êý¾Ý¡¡
Ϊʲô°¡£¿
ÈçºÎ½â¾öÕâ¸ö¼æÈÝÐÔ
Ïà¹ØÎÊ´ð£º
<script language="javascript">
var XMLHttpReq;
var cont=true;
//´´½¨XMLHttpRequest¶ÔÏó
function createXMLHttpRequest ......
ajax µÄÁ÷³ÌÊÇʲô
ÆÚ´ýѧϰ¡£¡£¡£
¿Í»§¶Ë²Ù×÷
Ò³Ãæ·¢³ö·þÎñÆ÷¶ËÇëÇó
µÃµ½ÇëÇó
¸üв¿·ÖÒ³Ãæ
»ù±¾Á÷³ÌÖªµÀ¸ÅÄîûÓ㬻¹ÊÇ×Ô¼ºÐ´¸öÀí½âµÃ¸üÉî¿Ì£¬ºÜ¼òµ¥µÄ¡£
ÎÒÒ²ºÜºÃÆ棬AjaxÈçºÎÓÃJavaScriptºÍXMLʵÏÖ ......
ÎÒÅóÓѵÄÒ»¸öASP.NETÒýÓÃÁËajax¼¼Êõ£¬binĿ¼ÏÂÃæÒ²ÓÐajaxpro.dll£¬ÎªÊ²Ã´·þÎñÆ÷²»ÐèÒª°²×°ajax²å¼þÒ²¿ÉÒÔÔËÐÐÄØ£¬ÕÕÀí˵Ӧ¸ÃÒª°²×°ASPAJAXExtSetup.msi
ÓÐ ajaxpro.dll¾Í¿ÉÒÔÁË
²»Í¬µÄaajx×é¼þ
AjaxPro¾ÍÊÇ¿ò¼ ......
HTML code:
<tr>
<td valign="top" height="100%" id="TD1" runat="server">
<asp:ScriptManager ID="ScriptManager1" runat=&q ......
Êý¾Ý¿âÒѾ·ÅÁ˶àÌõ¼Ç¼£¬¼ì²âµÄ¶¼ÊÇÓ¢Îĵģ¬¿ÉÊÇÓÐЩÓû§Ãû¿ÉÒÔÕý³£¼ì²â³öÒѱ»×¢²áÁË£¬ÓÐЩÓû§ÃûÊý¾Ý¿âÖÐȷʵ´æÔڵĵ«¾ÍÊǼì²â²»³öÒÑ´æÔÚ£¨ÔÚ×¢²áÒ³Ã滹ÊÇÏÔʾδ±»×¢²á£©£¬±ÈÈçÊý¾Ý¿âÖÐÓÐ Ò»¸öÓû§ÃûΪ£ºlb Î񱒵 ......