1.jqueryå¦ä½è·åajaxä¸dataçå¼
jqueryå¦ä½è·åajaxä¸dataçå¼
$.postã$.getæ¯ä¸äºç®åçæ¹æ³ï¼å¦æè¦å¤çå¤æçé»è¾ï¼è¿æ¯éè¦ç¨å°jQuery.ajax() ã$.ajaxçä¸è¬æ ¼å¼
$.ajax({
type: 'POST',源码android 烟花源码
url: url ,
data: data ,
ãã dataType:dataType ,
success: success ,
error: error
});
æ©å±èµæ
$.ajaxçåæ°æè¿°
åæ° æè¿°
url å¿ éãè§å®æ请æ±åéå°åªä¸ª URLã
data å¯éãæ å°æå符串å¼ãè§å®è¿å请æ±åéå°æå¡å¨çæ°æ®ã
success(data, textStatus, jqXHR) å¯éã请æ±æåæ¶æ§è¡çåè°å½æ°ã
dataType
å¯éãè§å®é¢æçæå¡å¨ååºçæ°æ®ç±»åã
é»è®¤æ§è¡æºè½å¤æï¼xmlãjsonãscript æ htmlï¼ã
$.ajaxéè¦æ³¨æçä¸äºå°æ¹ï¼
1ãdata主è¦æ¹å¼æä¸ç§ï¼htmlæ¼æ¥çï¼jsonæ°ç»ï¼form表åç»serialize()åºååçï¼éè¿dataTypeæå®ï¼ä¸æå®æºè½å¤æã
2ã$.ajaxåªæ交form以ææ¬æ¹å¼ï¼å¦æå¼æ¥æ交å å«<file>ä¸ä¼ æ¯ä¼ è¿ä¸è¿å»,éè¦ä½¿ç¨jquery.form.jsç$.ajaxSubmit
2024-12-26 22:19
2024-12-26 22:13
2024-12-26 22:12
2024-12-26 22:11
2024-12-26 21:48
2024-12-26 21:31
2024-12-26 21:30
2024-12-26 21:19