ajaxÔÚieϵÄÎÊÌâ
var xmlHttp; //´´½¨µÄÒ»¸öÈ«¾ÖµÄ±äÁ¿
function createxmlhttp(){
if (window.ActiveXObject) {
xmlHttp = new ActiveXObject("Microsoft.XMLHTTP");
}
else if (window.XMLHttpRequest) {
xmlHttp = new XMLHttpRequest();
}
}; //¸øÕâ¸öÈ«¾Ö¸½Ö±
window.onload = function(){
createxmlhttp();
xmlHttp.onreadystatechange=function(){
if(xmlHttp.readyState == 4)
alert(xmlHttp.responseText)
};
xmlHttp.open("GET","GetDataService?method=getProvinceByCountry&countryID=86",true)
xmlHttp.send(null);
};
//ÔÚÕâ¸öÒÔÉϵĵط½ ie ff ϶¼ÊǶԵÄÁË ¶¼¿ÉÒÔalert³öÀ´Êý¾Ý
//ÔÚÕâ¸öÒÔϵĵط½ Set·½·¨°ó¶¨ÔÚÒ»¸ö°´Å¦ÉÏ ffÏ¿ÉÒÔµ¯³öÊý¾Ý(²»¹Ü°²¶àÉÙ´Î) ieÈ´²»ÐÐ Ôõô°ìÁË£¿
function Set(){
xmlHttp.onreadystatechange=function(){
if(xmlHttp.readyState == 4)
alert(xmlHttp.responseText)
};
xmlHttp.open("GET","GetDataService?method=getProvinceByCountry&countryID=86",true)
xmlHttp.send(null)
};
Ìí¼Ó¸ö¸ßÁÁÉ«
JScript code:
var xmlHttp; //´´½¨µÄÒ»¸öÈ«¾ÖµÄ±äÁ¿
function createxmlh
Ïà¹ØÎÊ´ð£º
µÚ14Õ µÄÊ÷ÐͲ˵¥µÄÀý×Ó²»ÄÜÔÚIEÖÐÕý³£ÏÔʾ£¨Ê÷µÄ½á¹¹¿ÉÒÔÕ¹¿ª£¬µ«Õ¹¿ªºóÔÙµã»÷¾Í²»ÄÜÊÕËõÁË£©£¬µ«ÄÜÔڹȸèä¯ÀÀÆ÷ÖÐʹÓã¬Óп´´ËÊéµÄÅóÓÑÄÜÖ¸µãÏÂÂð£¿
ºÃÌù ºÇ
dfgfgfgffffff
лл¡£
......
ǰ̨´úÂ룺
C# code:
<%@ Page Language="C#" AutoEventWireup="true" CodeFile="tttt.aspx.cs" Inherits="tttt" %>
<%@ Register Assembly="System.W ......
ÎÒÏÖÔÚÓÃstruts2¿ò¼Ü,ÐèҪʹÓÃajaxʵÏÖ¾Ö²¿Ë¢Ð£¬µ«ÊÇ´ÓÈÝÆ÷Àï·µ»ØµÄÖµ²»ÖªµÀÔõô´Óstruts.xmlÅäÖÃÎļþÀïÓ³Éäµ½jspÒ³ÃæÀÒÔǰservletÀïдout.orint("xxxxx")¾Í¿ÉÒԵõ½~£¬µ«ÊÇÏÖÔÚÓÃstruts¾Í²»ÖªµÀÔõôР......
<%Response.ContentType="text/xml"
response.write "<ÕâÀïÊäÈë×Öĸ¾ÍÕý³£/>"
response.write "<999/>" Êý×ÖÔòÏÔʾ Ñùʽ±íÎÞ·¨²é¿´ XML ÊäÈë
%>
ÁíÍâ
......
Ç°Ãæ¿´µ½¹ýÕâ¸öÎÊÌâ,ûÓлشð,ÓÖÎÊÒ»ÏÂ,
ÈçºÎÔÚAJAX AccordionÖаó¶¨XML½ÚµãºÍ×Ó½Úµã
<cc1:Accordion ID="Accordion1" runat="server" DataSourceID="xdsProductMenu"> ......