[JavaScript]×ÔÒÑдµÄÒ»¸öAJAXÇëÇó£¢À࣢
¡¡¡¡ºÜ¶àÈ˶¼ÓùýAJAX¿Ø¼þ°É£¬AJAX¿Ø¼þ²»ÐèҪˢÐÂÒ³Ãæ¾Í¿ÉÒÔµ½ºǫ́ȥ¶Á³öÊý¾Ýµ½¿Í»§¶Ë£®AJAX¿Ø¼þ³ýÁËÓкÜìŵÄÌØЧÍ⣬ÆäÒª¹¦ÄܾÍÊDz»ÐèҪˢÐÂÕû¸öÒ³Ãæ¾Í¿ÉÒÔÈ¡µÃÓû§ËùÐèÒªµÄÊý¾Ý£¬ÎÒ°ÑÕâÒ»¿éµÄµÄ¹¦ÄÜ·â×°³ÉÒ»¸öÀ࣬·½±ãÈÕºó¿ÉÒÔÖظ´Ê¹Ó㬴úÂëÈçÏ£º
//Ajax Request Class Start
function AJAXRequestClass()
{
var adapter;
AJAXRequestClass.prototype.Send=function(par1,par2){return false;}
//SetLoadingEvent:Then server return value must handle this event.
AJAXRequestClass.prototype.SetLoadingEvent=function(FunctionName){if(FunctionName)
{AJAXRequestClass.prototype.DataHandler=FunctionName;return true;}else{return false;}}
AJAXRequestClass.prototype.ErrMessage="";
AJAXRequestClass.prototype.Status=0;
function tmpType()
{
tmpType.prototype.TEXT=0;
tmpType.prototype.XML=1;
tmpType.prototype.STREAM=2;
}
AJAXRequestClass.prototype.Type=new tmpType();
if(window.XMLHttpRequest)
{
adapter=new XMLHttpRequest();
}
else if(window.ActiveXObject)
{
try
{
adapter=new ActiveXObject("Msxml2.XMLHTTP");
}
catch(e)
{
try
{
adapter=new ActiveXObject("Microsoft.XMLHTTP");
}
catch(oc)
{
adapter=null
}
}
&nbs
Ïà¹ØÎĵµ£º
CookiesÊÇÒ»ÖÖÄܹ»ÈÃÍøÕ¾·þÎñÆ÷°ÑÉÙÁ¿Êý¾Ý´¢´æµ½¿Í»§¶ËµÄÓ²ÅÌ»òÄڴ棬»òÊÇ´Ó¿Í»§¶ËµÄÓ²Å̶ÁÈ¡Êý¾ÝµÄÒ»ÖÖ¼¼Êõ¡£CookiesÊǵ±Äãä¯ÀÀijÍøվʱ£¬ÓÉWeb·þÎñÆ÷ÖÃÓÚÄãÓ²ÅÌÉϵÄÒ»¸ö·Ç³£Ð¡µÄÎı¾Îļþ£¬Ëü¿ÉÒԼǼÄãµÄÓû§ID¡¢ÃÜÂë¡¢ä¯ÀÀ¹ýµÄÍøÒ³¡¢Í£ÁôµÄʱ¼äµÈÐÅÏ¢¡£µ±ÄãÔÙ´ÎÀ´µ½¸ÃÍøվʱ£¬Íøվͨ¹ý¶ÁÈ¡Cookies£¬µÃÖªÄãµÄÏà¹ØÐÅÏ¢£¬¾Í ......
//Register NameSpace for window.MSN
if(!window.MSN)
{
window.MSN = {};
}
if(!window.MSN.SET)
{
window.MSN.SET = {};
}
if(!window.MSN.SET.Utilities)
{
window.MSN.Utilities = {};
}
//Check you borwse type
//IE7 &IE8 & FF et ......
½ñÌìÎÒѧϰÁËÙ¡ÀÏʦ½²µÄajaxµÄ֪ʶ£º
Ò»¡¢ Ajax
a) ÔÊÐíä¯ÀÀÆ÷Óë·þÎñÆ÷ͨÐŶøÎÞÐëˢе±Ç°Ò³ÃæµÄ¼¼Êõ¶¼±»½Ð×öAjax¡£Êý¾ÝÔÚ¿Í»§¶ËÓë·þÎñÆ÷Ö®¼ä¶ÀÁ¢´«Êä¡£·þÎñÆ÷²»ÔÙ·µ»ØÕû¸öÒ³Ãæ
b) XMLHttpRequest£º¸Ã¶ÔÏ ......
JavaScript×÷ÓÃС½á£º
1 ´´½¨½Å±¾¿é
1: <script language=”JavaScript”>
2: JavaScript code goes here
3: </script>
2 Òþ²Ø½Å±¾´úÂë
1: <script language=”JavaScript”>
2: <!--
3: document.write(“ ......
1.´´½¨XMLHttpRequest¶ÔÏó£º
function newXMLHttpRequest() {
var requestObj;
if (window.XMLHttpRequest) {
// Non IE
requestObj = new ActiveObj('XMLHttpRequest');
} else {
//IE
requestObj = new ActiveObj('Microsoft.XMLHTTP');
}
return request ......