ajax ÖеÄstatusΪʲô=500°¡£¿£¿¼± - .NET¼¼Êõ / C#
<script type="text/javascript" language="javascript">
function excuAjax(url, funName, param) {
var xmlhttp;
if (window.ActiveXObject) {
xmlhttp = new ActiveXObject("Microsoft.XMLHTTP");
} else {
xmlhttp = new XMLHttpRequest();
}
xmlhttp.open("GET", url, true);
xmlhttp.onreadystatechange = function() {
if (xmlhttp.readyState == 4) {
if (xmlhttp.status == 200) {
var xml = xmlhttp.responseXML;
funName(xml);
}
}
}
xmlhttp.setRequestHeader("Content-Type", "application/JSON");
xmlhttp.send(param);
}
function getProject() {
var url = "http://localhost:3399/Web/WebService.asmx/HelloWorld";
excuAjax(url, callStr, null);
}
function callStr(rs) {
alert(rs);
}
function callProject(rs) {
var projects = document.getElementById("s_Project");
Ïà¹ØÎÊ´ð£º
ÎÒÏÖÔÚÓÃstruts2¿ò¼ÜÖÐÐèҪʹÓÃajaxʵÏÖ¾Ö²¿Ë¢Ð£¬µ«ÊÇ´ÓÈÝÆ÷Àï·µ»ØµÄÖµ²»ÖªµÀÔõô´Óstruts.xmlÅäÖÃÎļþÀïÓ³Éäµ½jspÒ³ÃæÀÒÔǰservletÀïдout.orint("xxxxx")¾Í¿ÉÒԵõ½~£¬µ«ÊÇÏÖÔÚÓÃstruts¾Í²»ÖªµÀÔõô ......
ÎÒÏÖÔÚÓÃstruts2¿ò¼Ü,ÐèҪʹÓÃajaxʵÏÖ¾Ö²¿Ë¢Ð£¬µ«ÊÇ´ÓÈÝÆ÷Àï·µ»ØµÄÖµ²»ÖªµÀÔõô´Óstruts.xmlÅäÖÃÎļþÀïÓ³Éäµ½jspÒ³ÃæÀÒÔǰservletÀïдout.orint("xxxxx")¾Í¿ÉÒԵõ½~£¬µ«ÊÇÏÖÔÚÓÃstruts¾Í²»ÖªµÀÔõôР......
ÎÒÓÐÒ»¸öÀàËÆµÄxmlµÄ string£¬Ïëͨ¹ý±éÀúÔõô¸öxml Êä³öÎÒÏëÒªµÄelementµÄÖµ
xml Ϊ£º
<Discover xmlns="urn:schemas-microsoft-com:xml-analysis">
<RequestType>DISCOVER_XML_ME ......
Ŀǰһ¸öÏîÄ¿£¬Óöµ½¸ö´óÎÊÌ⣬Ҫ¸ãÒ»¸öµç×ÓµØÍ¼£¬Ð¡µÜ´ÓÀ´Ã»¸ã¹ýgis·½ÃæµÄ¶«Î÷£¬Õâ´ÎÓ²×ÅͷƤÉÏÁË¡£ ÏÂÃæÊÇĿǰÓöµ½µÄ¸öÎÊÌâ¡£¡£¡£
OpenLayerÔõôÏòºǫ́·¢ËÍajaxÇëÇ󣨺ǫ́ÊÇSSH¿ò¼Ü£©£¬ÔÚÉêÇëµ½ºǫ́µÄactionºó£¬²é ......
Çë½Ì¸ßÈË£¬AjaxÔÀíÏêϸ½²½â ¼°´úÂë˵Ã÷
ÎÒ²Á£¬ÉÏgoogle°¡¡£
http://www.w3school.com.cn/ajax/index.asp
Â¥Ö÷ʲôÒâÍ¼ÄØ£¿
³ö ´¦:http://www.javaeye.com/topic/636187
û×ö¹ýwebǰ¶Ë£¬ËùÒÔÍêȫûÓÐÓà ......