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

ajaxÂÒÂëÎÊÌâ

JScript code:

function createRequest(){
if(window.XMLHttpRequest){
httpRequest=new XMLHttpRequest();
}else if(window.ActiveXObject){
try{
httpRequest = new ActiveXObject("Msxml2.XMLHTTP");
}catch(e){
try{
httpRequest = new ActiveXObject("Microsoft.XMLHTTP");
}catch(e){}
}
}
}

function sendRequest(url,nam1,nam2){
createRequest();
id1=nam1
id2=nam2
httpRequest.open("GET",url,true);
httpRequest.setRequestHeader('Content-type', 'application/x-www-form-urlencoded; charset=GB2312');

httpRequest.onreadystatechange=processResponse;
httpRequest.send(null);
}

function processResponse(){
if(httpRequest.readyState == 4){
if(httpRequest.status == 200){
//alert('200');
var result=httpRequest.responseText;
//var result=httpRequest.responseXML//.getElementsByTagName("div");
alert(result);

//var area=document.getElementById(id2);
//area.innerHTML='<textarea rows=7 cols=49>'+result.value+'</textarea>'


Ïà¹ØÎÊ´ð£º

´ó¼Ò¿´¿´ÎҵĴúÂëÓÐʲôÎÊÌ⣨¹ØÓÚajaxµÄ£©

ÔÚ¼ÒÑо¿ajax£¬¿´Á˱ðÈ˵ÄÒ»¸öÍøÉϹºÎïÉ̳ÇÏîÄ¿µÄÔ´´úÂ룬×Ô¼ºÒ²À´·Â±ðÈ˵Ķ«Î÷Á·Ï°Á·Ï°£¬Ã»Ïë³öÎÊÌâÁË£¡Ò»ÏµÄÕâЩ´úÂëÊÇÎÒ·ÂÕÕ±ðÈËдµÄ¡£ÎÒÊÇÏëÈÃ×¢²áµÄÈËÌîдÓû§Ãû£¬¹â±êÀ뿪Óû§ÃûºóÃæµÄÌîд¿Õ°×´¦ºóÁ¢¿ÌÀûÓÃaj ......

ajax È¡²»µ½Êý¾Ý

http://localhost:8080/xx/zz.do  ÏÔʾ outµÄ xml Êý¾Ý

xml.open("GET",arguments[0],true);// arguments[0]ÊÇ /xx/zz.do

xml.send();

alert(arguments[0]);//Õâ±ßÓÐ

x ......

ajaxºólocation.reload()ÎÞЧ

»Øµ÷º¯ÊýÈçÏ£º
function deleteCallBack(data)
{
if(data=="ɾ³ý³É¹¦")
{
alert(data);
location.reload();
}
else
{
alert(data);
}
}
²»Ìøת Ö»ÊÇÏÔʾalertÐÅÏ ......

Jquery1.3.2µÄAJAXÎÊÌâ

HuiFu.aspxÒ³Ãæ


<%@ Page Language="C#" AutoEventWireup="true" CodeFile="HuiFu.aspx.cs" Inherits="fdfdcs" %>

<!DOCTYPE html PUBLIC &q ......
© 2009 ej38.com All Rights Reserved. ¹ØÓÚE½¡ÍøÁªÏµÎÒÃÇ | Õ¾µãµØͼ | ¸ÓICP±¸09004571ºÅ