Ò׽ؽØͼÈí¼þ¡¢µ¥Îļþ¡¢Ãâ°²×°¡¢´¿ÂÌÉ«¡¢½ö160KB

AJAX XMLHttpRequest


XMLHttpRequest ¶ÔÏóʹ AJAX ³ÉΪ¿ÉÄÜ¡£
XMLHttpRequest
XMLHttpRequest ¶ÔÏóÊÇ AJAX µÄ¹Ø¼ü¡£
¸Ã¶ÔÏóÔÚ Internet Explorer 5.5 Óë 2000 Äê 7 Ô·¢²¼Ö®ºó¾ÍÒѾ­¿ÉÓÃÁË£¬µ«ÊÇÔÚ 2005 ÈËÃÇ¿ªÊ¼ÌÖÂÛ AJAX ºÍ Web 2.0 ֮ǰ£¬Õâ¸ö¶ÔÏó²¢Ã»Óеõ½³ä·ÖµÄÈÏʶ¡£
´´½¨ XMLHttpRequest ¶ÔÏó
²»Í¬µÄä¯ÀÀÆ÷ʹÓò»Í¬µÄ·½·¨À´´´½¨ XMLHttpRequest
¶ÔÏó¡£
Internet Explorer ʹÓà ActiveXObject
¡£
ÆäËûä¯ÀÀÆ÷ʹÓÃÃûΪ XMLHttpRequest
µÄ JavaScript ÄÚ½¨¶ÔÏó¡£
Òª¿Ë·þÕâ¸öÎÊÌ⣬¿ÉÒÔʹÓÃÕâ¶Î¼òµ¥µÄ´úÂ룺
var XMLHttp=null
if (window.XMLHttpRequest)
{
XMLHttp=new XMLHttpRequest()
}
else if (window.ActiveXObject)
{
XMLHttp=new ActiveXObject("Microsoft.XMLHTTP")
}
´úÂë½âÊÍ£º
Ê×ÏÈ´´½¨Ò»¸ö×÷Ϊ XMLHttpRequest ¶ÔÏóʹÓÃµÄ XMLHttp
±äÁ¿¡£°ÑËüµÄÖµÉèÖÃΪ null¡£
È»ºó²âÊÔ window.XMLHttpRequest
¶ÔÏóÊÇ·ñ¿ÉÓá£ÔÚа汾µÄ Firefox, Mozilla, Opera ÒÔ¼° Safari ä¯ÀÀÆ÷ÖУ¬¸Ã¶ÔÏóÊÇ¿ÉÓõġ£
Èç¹û¿ÉÓã¬ÔòÓÃËü´´½¨Ò»¸öжÔÏó£ºXMLHttp=new XMLHttpRequest()

Èç¹û²»¿ÉÓã¬Ôò¼ì²â window.ActiveXObject
ÊÇ·ñ¿ÉÓá£ÔÚ Internet Explorer version 5.5 ¼°¸ü¸ßµÄ°æ±¾ÖУ¬¸Ã¶ÔÏóÊÇ¿ÉÓõġ£
Èç¹û¿ÉÓã¬Ê¹ÓÃËüÀ´´´½¨Ò»¸öжÔÏó£ºXMLHttp=new ActiveXObject()

¸Ä½øµÄÀý×Ó
һЩ³ÌÐòԱϲ»¶Ê¹ÓÃ×îÐÂ×î¿ìµÄ°æ±¾µÄ XMLHttpRequest ¶ÔÏó¡£
ÏÂÃæµÄÀý×ÓÊÔͼ¼ÓÔØ΢Èí×îа汾µÄ "Msxml2.XMLHTTP"£¬ÔÚ Internet Explorer 6 ÖпÉÓã¬Èç¹ûÎÞ·¨¼ÓÔØ£¬ÔòºóÍ˵½ "Microsoft.XMLHTTP"£¬ÔÚ Internet Explorer 5.5 ¼°Æäºó°æ±¾ÖпÉÓá£
function GetXmlHttpObject()
{
var xmlHttp=null;
try
{
// Firefox, Opera 8.0+, Safari
xmlHttp=new XMLHttpRequest();
}
catch (e)
{
// Internet Explorer
try
{
xmlHttp=new ActiveXObject("Msxml2.XMLHTTP");
}
catch (e)
{
xmlHttp=new ActiveXObject("Microsoft.XMLHTTP");
}
}
return xmlHttp;
}
´úÂë½âÊÍ£º
Ê×ÏÈ´´½¨ÓÃ×÷ XMLHttpRequest ¶ÔÏóµÄ XMLHttp
±äÁ¿¡£°ÑËüµÄÖµÉèÖÃΪ null¡£
°´ÕÕ web ±ê×¼´´½¨¶ÔÏó (Mozilla, Opera ÒÔ¼° Safari)£ºXMLHttp=new XMLHttpRequest()

°´ÕÕ΢ÈíµÄ·½Ê½´´½¨¶ÔÏó£¬ÔÚ Internet Explorer 6 ¼°¸ü¸ßµÄ°æ±¾¿ÉÓãºXMLHttp=new ActiveXObjec


Ïà¹ØÎĵµ£º

Áú²©AJAX¿ò¼Ü »ùÓÚwebµÄͼÐοؼþ¼°¿ÉÊÓ»¯Éè¼Æ

http://www.longboo.com/
·ÖÒ³
http://www.longboo.com/Samples/linb/widgets/TreeGrid.Paging/index.html
Êý¾Ý¿â²éѯ¹¤¾ß
http://www.longboo.com/Samples/comb/OrderManagement/index.html
email¹¤¾ß
http://www.longboo.com/Samples/comb/OutLook/index.html
Íøµê
http://www.longboo.com/Samples/linb/Template ......

°×»° Ajax ¼°ÆäÈëÃÅ»ù´¡(1)

    Ò»¡¢°×»°AjaxµÄÔ­Àí
    Õâ¸öÆäʵҪ´ÓC/SºÍB/SµÄÔ­Àí˵Æð¡£Windows²Ù×÷ϵͳµÄµ®Éú£¬Îªµ¥»úͨÐÅÌṩÁ˺ܴóµÄÖ§³Ö£¬³ÌÐòÉè¼ÆÒ²´ÓDOSÔçÆڵĵ¥ÈÎÎñµ¥Óû§ÏòÍøÂçµÄ·Ö²¼Ê½Ó¦Óùý¶È¡£C/SÌṩµÄ¿Í»§/·þÎñÆ÷±à³ÌģʽΪÍøÂçÓ¦ÓÃÌṩÁËÒ»¸öÓÐЧµÄͨÐÅÊֶΡ£ä¯ÀÀÆ÷ÓëWeb·þÎñÆ÷Ö®¼äµÄÇëÇó/ ·þÎñ£¬¾ÍÊ ......

°×»° Ajax ¼°ÆäÈëÃÅ»ù´¡(2)

    ËÄ¡¢³£¼ûAjax±à³Ì¿ò¼Ü
    ¼ÈÈ»ÉÏÊöAjax¿ò¼ÜÒѾ­Äܹ¤×÷ÁË£¬ÎªÊ²Ã´»¹ÓÐÄÇô¶àµÄ¿ò¼ÜÄØ£¿
    Ëæ×ÅÒ³ÃæµÄ¸´ÔÓ£¬¿ÉÄÜÐèÒªÊéд´óÁ¿µÄJavascript½Å±¾À´¶ÔÒ³ÃæÖеÄDOM¶ÔÏó½øÐпØÖÆ£¬¹¤×÷Á¿ºÍ¸´ÔӶȻá´ó´óÔö¼Ó¡£Ajax±à³Ì¿ò¼Üͨ³£ÀûÓÃÃæÏò¶ÔÏóµÄ·½·¨£¬¶ÔһЩ»ù±¾µÄ¶ÔÏóºÍÐÐΪ¼° ......

ajax1.0²»Ö§³ÖResponse.writeÀïÃæµ÷ÓÃjavascript

ÎÊÌ⣺
    µ±Óû§µã»÷ɾ³ý°´Å¥Ê±£¬³ÌÐòµ÷ÓÃResponse.write("<script>alert('ÊÇ·ñ¼ÌÐø')</script>")ÊÇÒ³Ãæ»áµ¯³ö´íÎó£º
Sys.WebForms.PageRequestManagerParserErrorException:The
message received from the server count not be parsed.Common causes for
this error are when ......
© 2009 ej38.com All Rights Reserved. ¹ØÓÚE½¡ÍøÁªÏµÎÒÃÇ | Õ¾µãµØͼ | ¸ÓICP±¸09004571ºÅ