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

Ïê½âAJAXºËÐÄÖеÄXMLHttpRequest¶ÔÏó

 XMLHttpRequest ¶ÔÏóÊÇAJAX¹¦ÄܵĺËÐÄ£¬Òª¿ª·¢AJAX³ÌÐò±ØÐë´ÓÁ˽âXMLHttpRequest ¶ÔÏó¿ªÊ¼¡£
    Á˽âXMLHttpRequest ¶ÔÏó¾ÍÏÈ´Ó´´½¨XMLHttpRequest ¶ÔÏó¿ªÊ¼£¬ÔÚ²»Í¬µÄä¯ÀÀÆ÷Öд´½¨XMLHttpRequest ¶ÔÏóʹÓò»Í¬µÄ·½·¨£º
    ÏÈ¿´¿´IE´´½¨XMLHttpRequest ¶ÔÏóµÄ·½·¨£¨·½·¨1£©£º
var xmlhttp = new ActiveXObject("Msxml2.XMLHTTP"); 
//ʹÓýÏа汾µÄ IE ´´½¨ IE ¼æÈݵĶÔÏó£¨Msxml2.XMLHTTP£©
var xmlhttp = new ActiveXObject("Microsoft.XMLHTTP");
//ʹÓýÏÀÏ°æ±¾µÄ IE ´´½¨ IE ¼æÈݵĶԣ¨Microsoft.XMLHTTP£©
    ¶ø Mozilla¡¢Opera¡¢Safari ºÍ´ó²¿·Ö·ÇIEµÄä¯ÀÀÆ÷¶¼Ê¹ÓÃÏÂÃæÕâÖÖ·½·¨£¨·½·¨2£©´´½¨XMLHttpRequest ¶ÔÏó£º
var xmlhttp = new XMLHttpRequest();
    ʵ¼ÊÉÏInternet Explorer ʹÓÃÁËÒ»¸öÃûΪ XMLHttp µÄ¶ÔÏ󣬶ø²»ÊÇ XMLHttpRequest ¶ÔÏ󣬶ø Mozilla¡¢Opera¡¢Safari ºÍ ´ó²¿·Ö·Ç Microsoft ä¯ÀÀÆ÷¶¼Ê¹ÓõÄÊǺóÕߣ¨ÏÂÎÄͳ³Æ XMLHttpRequest ¶ÔÏ󣩡£IE7¿ªÊ¼Ò²¿ªÊ¼Ê¹ÓÃXMLHttpRequest ¶ÔÏóÁË¡£
    ÔÚ´´½¨ XMLHttpRequest ¶ÔÏóµÄʱºòÈç¹û²»Í¬µÄä¯ÀÀÆ÷ʹÓÃÁ˲»ÕýÈ·µÄ·½·¨ä¯ÀÀÆ÷¶¼½«»á±¨´í£¬²¢ÇÒÎÞ·¨Ê¹ÓøöÔÏó¡£ËùÒÔÎÒÃÇÐèÒªÒ»ÖÖ¿ÉÒÔ¼æÈݲ»Í¬ä¯ÀÀÆ÷µÄ´´½¨XMLHttpRequest ¶ÔÏóµÄ·½·¨£º
    ´´½¨¼æÈݶàä¯ÀÀÆ÷µÄ XMLHttpRequest ¶ÔÏó·½·¨
 
var xmlhttp = false; //´´½¨Ò»¸öбäÁ¿ request ²¢¸³Öµ false¡£Ê¹Óà false ×÷ΪÅжÏÌõ¼þ£¬Ëü±íʾ»¹Ã»Óд´½¨ XMLHttpRequest ¶ÔÏó¡£
function CreateXMLHttp(){
try{
xmlhttp = new XMLHttpRequest();  //³¢ÊÔ´´½¨ XMLHttpRequest ¶ÔÏ󣬳ý IE ÍâµÄä¯ÀÀÆ÷¶¼Ö§³ÖÕâ¸ö·½·¨¡£
}
catch (e){
try{
xmlhttp = new ActiveXObject("Msxml2.XMLHTTP");  //ʹÓýÏа汾µÄ IE ´´½¨ IE ¼æÈݵĶÔÏó£¨Msxml2.XMLHTTP£©
}
catch (e){
try{
xmlhttp = new ActiveXObject("Microsoft.XMLHTTP"); //ʹÓýÏÀÏ°æ±¾µÄ IE ´´½¨ IE ¼æÈݵĶÔÏó£¨Microsoft.XMLHTTP£©¡£
}
catch (failed){
xmlhttp = false;  //Èç¹ûʧ°ÜÔò±£Ö¤ request µÄÖµÈÔȻΪ false¡£
}
}
}
return xmlhttp;
}
ÅжÏÊÇ·ñ´´½¨³É¹¦¾ÍºÜ¼òµ¥ÁË
if (!xmlhttp){
//´´½¨XMLHttpRequest ¶ÔÏóʧ°Ü!
}
else{
//´´½¨³É¹¦!
}
 
    ´´½¨ºÃÁËXMLHttpRequest ¶ÔÏóÎÒÃ


Ïà¹ØÎĵµ£º

JsTreeÊ÷¿Ø¼þ_AjaxÒì²½¼ÓÔؽڵãÇÒÓи÷ÖÖ¸÷ÑùµÄ¹¦ÄÜ

ÕÛÌÚÁ˺ó¤Ê±¼ä£¬ÖÕÓÚÔÚ½ñÌìÓÃJsTree²å¼þʵÏÖÁËAjaxÒì²½¼ÓÔؽڵãµÄ¹¦ÄÜ¡£
Zero.aspxÒ³£¬¸ÃÒ³ÓÃÓÚÏÔʾÊ÷¿Ø¼þ¡£
<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="Zero.aspx.cs" Inherits="VistaToNewSchol.Zero" %>
 
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http:/ ......

ajax֪ʶµã

1.XMLHttpRequest¶ÔÏó
  open("method","URL""[,asyncFlag[,"userName"[, "password"]]])
    ½¨Á¢¶Ô·þÎñÆ÷µÄ·ÃÎÊ¡£ÆäÖÐmethod²ÎÊý¿ÉÒÔʹÓÃGET¡¢POST¼°PUT£¬URL²ÎÊý¼È¿ÉÒÔʹÓþø¶ÔµØÖ·£¬Ò²¿ÉÒÔʹÓÃÏà¶ÔµØÖ·£¬´ËÍ⻹°üÀ¨Ó뽨Á¢Á¬½ÓÏà¹ØµÄÈý¸ö²ÎÊý
&nbs ......

AJAX¿ò¼Ü±È½Ï£ºjQuery£¬Mootools£¬Dojo£¬Ext JS

       AJAXÊÇweb20µÄ»ùʯ£¬ÏÖÔÚÍøÉÏÁ÷Ðм¸ÖÖ¿ªÔ´µÄAJAX¿ò¼Ü£¬±ÈÈ磺jQuery,Mootools,Dojo,Ext JSµÈµÈ£¬ÄÇôÎÒÃǵ½µ×ÔÚʲôÇé¿öϸÃʹÓÃÄǸö¿ò¼Ü£¿ÒÔÏÂÊÇÒ»×éÕª³­µÄÊý¾Ý£º      
       AjaxianÔÚ2007Äêµ×¶ÔAjax¹¤¾ß½øÐÐÁ˵÷ ......

Ajax£ºÓµ±§JSON£¬ÈÃXML×ß¿ª


Ajax(Asynchronous JavaScript and XML)˵µ½µ×¾ÍÊÇÒ»ÖÖä¯ÀÀÆ÷Òì²½¶ÁÈ¡·þÎñÆ÷ÉÏXMLÄÚÈݵļ¼Êõ¡£ÏÖÔڵļ¼Êõ·²ÊǸúXML³¶ÉϹØϵ£¬ÔÙ¼ÓÉϸö¸ÅÄî×ö»Ï×Ó£¬¾ÍÏñ½ð×°ÁËÒ»Ñù£¬×§µÃ²»ÐС£ÃÅÍâ µÄÈË¿´µÃºÜÊÇÈÈÄÖ£¬ÃÅÀïµÄÈËÒ¡Ò¡Í·²»ÍâÈçÊÇ¡£XMLÄØ£¬¿çƽ̨µÄг±ÓïÑÔ£¿ÆäʵXML£½TXT¡£
XMLÖ»ÊÇ·ûºÏºÜ¶à¹æ·¶µÄÎı¾¡£Ëü±¾Éíʲô¶¼²»ÊÇ£¬Ö ......

·Â°Ù¶ÈajaxËÑË÷Ìáʾ£¨jsp£©

<%@ page language="java" import="java.util.*" pageEncoding="GB2312"%>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
  <head>
    <title>index</title>
<meta http-equiv="pragma" content="no-cache"&g ......
© 2009 ej38.com All Rights Reserved. ¹ØÓÚE½¡ÍøÁªÏµÎÒÃÇ | Õ¾µãµØͼ | ¸ÓICP±¸09004571ºÅ