AJAX ³õѧ(ת)
ÕâÁ½ÌìÒ»Ö±ÔÚÂñÍ·¿àÁ·AJAX¼¼Êõ£¬ËäÈ»ÍøÉ϶ÔAJAXµÄ¿´·¨¸÷Óкûµ£¬ÔÚÎÒ¿´À´AJAX¶ÔÎÒÀ´Ëµ»¹ÊÇÒ»¸öºÜ²»´íµÄ¼¼Êõ£¬ËüÔںܴóµÄ³Ì¶ÈÉϼõÇáÁË·þÎñÆ÷µÄ¸ºµ££¬°ÑһЩ¼òµ¥µÄrequestͨ¹ýÀûÓÃjavascript·½·¨´´½¨Ò»¸öXMLHttpRequest¶ÔÏó·¢ËͺͽÓÊÕ·þÎñÆ÷µÄÐÅÏ¢£¬²»ÒªÍ¨¹ýË¢ÐÂÒ³Ãæ¾ÍÄܵõ½×Ô¼ºÏëÒªµÄЧ¹û£¬Õâ¼òÖ±ÊDz»¿É˼Òé¡£ÏÂÃæ¸ø³öÒ»¶ÎAJAX+Servlet+JavascriptÒ»¶Î×î¼òµ¥µÄ´úÂ빩³õѧÕ߲ο¼£¬×¢ÒâÊdzõѧÕßŶ ¡£
<!DOCTYPE HTML PUBLIC "-//W3C//DTD XHTML 1.0 Strict //EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>Sending Request Data Using GET and POST</title>
<script type="text/javascript">...
var xmlHttp;
function createXMLHttpRequest() ...{
if(window.ActiveXObject) ...{
xmlHttp = new ActiveXObject("Microsoft.XMLHTTP");
} else if(window.XMLHttpRequest) ...{
xmlHttp = new XMLHttpRequest();
}
}
function createQueryString() ...{
var firstName = document.getElementById("firstName").value;
var middleName = document.getElementById("middleName").value;
var birthday = document.getElementById("birthday").value;
var queryString = "firstName = " + firstName + "&middleName=" + middleName + "&birthday=" + birthday;
return queryString;
}
function doRequestUsingGET() ...{
createXMLHttpRequest();
var queryString = "GetAndPostExample?";
queryString = queryString + createQueryString()
+ "&timeStamp=" + new Date().getTime();
xmlHttp.onreadystatechange = handleStateChange;
xmlHttp.open("GET", queryString, true);
xmlHttp.send(null);
}
function doRequestUsingPOST() ...{
createXMLHttpRequest();
var queryString = "GetAndPostExample?";
qu
Ïà¹ØÎĵµ£º
1.ʲôÊÇAjax?
AjaxµÄÈ«³ÆÊÇ£ºAsynchronousJavaScript+XML
2.AjaxµÄ¶¨Ò壺
Ajax²»ÊÇÒ»¸ö¼¼Êõ£¬Ëüʵ¼ÊÉÏÊǼ¸ÖÖ¼¼Êõ£¬Ã¿ÖÖ¼¼Êõ¶¼ÓÐÆä¶ÀÌØÕâ´¦£¬ºÏÔÚÒ»Æð¾Í³ÉÁËÒ»¸ö¹¦ÄÜÇ¿´óµÄм¼Êõ¡£
3.Ajax°üÀ¨£º
XHTMLºÍCSS
ʹÓÃÎĵµ¶ÔÏóÄ£ÐÍ(DocumentObjectModel)×÷¶¯Ì¬ÏÔʾºÍ½»»¥
ʹÓÃXMLºÍXSLT×öÊý¾Ý½»»¥ ......
ajaxµÄÁбíÁª¶¯Ê¾Àý
1¡¢ ÊäÈëÓò£º
ÇëÑ¡ÔñÊ¡£º
<select id="sel1" onchange="return choose(this);">
<option value="">--ÇëÑ¡Ôñ--</option>
<option value="1">ºþÄÏÊ¡</option>
&nb ......
ÎÒÓÃActiveXObject("Microsoft.xmldom")À´×°ÔØxmlÎĵµÊ±£¬¾¹È»ÀÏÊÇÌáʾװÔØʧ°Ü£¬ºóÀ´ÉÏÍøËÑË÷ÁËÏ£¬ËµÊDz»ÄÜÖ±½Ó°üº¬Õâ5¸ö·ûºÅ£¨'><&"£©£¬±ØÐëÑ¡ÓÃ&xx;·½Ê½À´×ªÒ壬¿ÉÎÒÕÒ±éXMLҲû·¢ÏÖÕâЩ¡£
ºóÀ´ÎÒ¶ÀÐÐÅųý£¬²Å·¢ÏÖÓÐÒ»¸öÔªËصÄÊôÐÔֵΪÓГ|”£¬È¥³ýºó¾ÍÕý³£ÁË¡£ÎÒÕæÊǾõµÃÆæ¹Ö£¬ÍøÉÏҲûÓÐ˵ ......
»ùÓÚJQuery¿ò¼ÜµÄAJAX
Ç°¼¸Ìì·¢Á˸öÌù£¬·ÖÏíÁËprototype¿ò¼Ü¹ØÓÚAJAX·½ÃæµÄѧϰ¹ý³Ì¡£È»ºóÓÐÈË˵jquery¿ò¼Ü¸ü·½±ã¡£
ÕýºÃÏîÄ¿ÖÐ×¼±¸Ê¹ÓÃthickbox£¬ÓÚÊǸɴàÅ×Æúprototype.js£¬¿´Æðjquery.jsÁË¡£JQueryȷʵ²»´í£¬Ìå»ý±È PrototypeСÁËÐí¶à£¬¶øÇÒʹÓÃÆðÀ´¸ü·½±ã¸üÁé»î¡£ÓÐÈË˵PrototypeÏñJAVA£¬Õýͳ£»¶øJQueryÏñRuby£¬Áé»î£ ......
jsÎļþ:
var where=" where pd_Isjifen=0 and pd_Isok=1"; //²éѯÌõ¼þ
var psize=16; //²éѯÊý¾ÝÊýÄ¿
var pindex=0;//µ±Ç°Ò³Êý
var order=" order by pd_Update desc,type_sort,pd_brand,pd_typeid"; //ÅÅÐòÌõ¼þ
var temp=0; //Ä£°åÃû³Æ
var Pcount=0;
//»ñÈ¡²ÎÊý
function getUrlPara(p ......