menu

开发进行时...

crazy coder

Avatar

Ajax开发注意事项~积累中~

Ajax 入门就不说了~确实比较简单。

(1)xmlhttp.onreadystatechange = updatepage不要写成xmlhttp.onreadystatechange = updatepage(...)
这样会报类型不匹配的错误。

(2)XMLHTTPRequest and XMLHTTP
XMLHTTPRequest是IE5.0及以上版本。
xmlhttp = new ActiveXObject("Microsoft.XMLHTTPREQUEST")
xmlhttp = new ActiveXObject("Microsoft.XMLHTTP")
如果xmlhttp.responseText值为空可以换一下实例化方式。

(3)
request = new ActiveXObject("Microsoft.XMLHTTP");
if (request)
{
request.onreadystatechange = CallbackHandler;
request.open("GET", URL, true);
request.send();
}

在Firefox浏览器中必须写成
request.send(null);

(4)
http://weblogs.asp.net/mschwarz/archive/2005/11/02/429285.aspx

(5)
XmlHttpRequest not working

你可以问问天魔,我们也采用了一些AJAX技术

评论已关闭