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

ajaxÌá½»±íµ¥

ajaxÌá½»±íµ¥
¹Ø¼ü×Ö: ajax
function ajaxSubmitForm(form, resultDivId) {          
var elements = form.elements;// Enumeration the form elements          
var element;          
var i;          
var postContent = "";// Form contents need to submit         
for(i=0;i<elements.length;++i) {                  
var element=elements[i];          
if(element.type=="text" || element.type=="textarea" || element.type=="hidden") {          
postContent += encodeURIComponent(element.name) + "=" + encodeURIComponent(element.value) + "&";          
}          
else if(element.type=="select-one"||element.type=="select-multiple") {          
var options=element.options,j,item;          
for(j=0;j<options.length;++j){          
item=options[j];          
if(item.selected) {                  
postContent += encodeURIComponent(element.name) + "=" + encodeURIComponent(item.value) + "&";                         &n


Ïà¹ØÎĵµ£º

javaÖÐʹÓÃAjax¼¼Êõ

      ajax¼¼ÊõÊÇʹҳÃæÄֲܾ¿Ë¢ÐµÄÒ»ÖÖ¼¼Êõ,È«³ÆÓ¦¸ÃÊÇasynchronous JavaScript and xml´Ó¼¸¸öµ¥´Ê¾ÍÖªµÀËüµÄÇëÇóÏìÓ¦µÄ´¦ÀíÊÇÒì²½µÄ,¶øÇÒʹÓõÄÊÇJavaScriptºÍxml¼¼Êõ.
      ÎÒÃÇÔÚjavaÖÐʹÓÃajax¼¼Êõ×î¼òµ¥µÄÊÇʹÓÃËüµÄÒ»¸ö¿ò¼ÜdwrÖ»Òªµ¼ÈëÕâ¸ö°ü,×öÏàÓ¦µÄÅäÖÃ,¿É ......

Ajaxʵʱ»ñÈ¡ÐÅÏ¢

AjaxµÄIE»º´æÎÊÌ⣬»áÔì³ÉÓÃopenʱÓÃget·½·¨²»ÄÜÖظ´Ìá½»,µ¼Ö»ñÈ¡²»µ½ÊµÊ±µÄÐÅÏ¢¡£½â¾öµÄ°ì·¨ÓÐÒÔϼ¸ÖÖ£º 
1.¿Í»§¶ËÔÚurlºóÌí¼ÓËæ»úÊý. 
new Date().getTime()»òÕßMath.Random() 
»òÕßËÍÇëÇóÇ°¼ÓÉÏ 
XMLHttpRequest.setRequestHeader("If-Modified-Since","0") 
2.»òÕßÓÃpost·½·¨Ìá½»  ......

µÚ¶þ²½£º·ºÐÍͨÓö¯Ì¬²éѯ(LinQ+Ajax)

ÎҵĴºÇï³ÕÃεڶþ²½£º
дһ¸ö ͨÓÃµÄ ¶ÔÏó ÁÐ±í £¬»¹ °üº¬ ËÑË÷ºÍ ÊôÐÔ¹ýÂË¡£
¾ßÌåµÄЧ¹ûÊÇ£º
µ±Ð ҵÎñ Ìí¼ÓÒ»¸ö ±íµÄʱºò£¬Ö»ÐèÒªÔÚ ¶ÔÏóÄ£ÐÍÀïµÄ Ìí¼ÓÒ»¸ö model
ºǫ́¼¸ºõ²»Ðèд´úÂë¡£
(ÎÒÊǺǫ́£º¼¤¶¯ÈËÐÄ£¡)
µ÷ÓõĶÔÏ󣬵ڼ¸Ò³£¬ÊôÐ﵀ ¹ýÂË ºÍËÑË÷È«ÊÇ Ç°Ì¨µÄAjax²ÎÊý¿ØÖÆ
(ÎÒÊÇǰ̨£º#$!@#$%$^#$% ......

php¼ì²âajax·½Ê½µÄµ÷ÓÃÇëÇó

±ÈÈçÒª¸øÓû§±¨¸æÒ»¸ö´íÎó£¬ÓÃÏÂÃæµÄ·½·¨£º
ʹÓÃset_error_handlerÉèÖÃ×Ô¼ºµÄ´íÎó´¦Àíº¯Êý£¬ÔÚ±¨´íµÄµØ·½Ê¹ÓÃtrigger_error£¬ÔÚ×Ô¶¨ÒåµÄ´íÎó´¦Àíº¯ÊýÖиøÓû§ÏÔʾһ¸ö³ö´íÐÅÏ¢Ò³Ãæ¡£
µ«
ÊÇÈç¹ûµ÷ÓÃtrigger_errorµÄÕâ¸öÒ³ÃæÊDZ»Ò»´ÎajaxÇëÇó´¥·¢µÄ£¬ÄÇôajax·µ»Øºó½«µÃµ½Ò»´ó¶ÑÓÃÓÚÏÔʾ´íÎóµÄhtml´úÂë¡£¶øÒ»°ã
ajaxµ÷Óö ......
© 2009 ej38.com All Rights Reserved. ¹ØÓÚE½¡ÍøÁªÏµÎÒÃÇ | Õ¾µãµØͼ | ¸ÓICP±¸09004571ºÅ