[JavaScript] jQuery中ajax和post处理json的不同 →→→→→进入此内容的聊天室

来自 , 2019-02-24, 写在 JavaScript, 查看 135 次.
URL http://www.code666.cn/view/1bd2caf9
  1. function haha() {  
  2.     jQuery.post("addComment!comment.action",  
  3.      function aa(data) {  
  4.           data = eval(data);//POST方法必加,ajax方法自动处理了  
  5.           alert(data[0].userId);  
  6.           alert(data[0].userName);  
  7.     },  
  8.     "json"  
  9.     );  
  10.      
  11.     jQuery.ajax({  
  12.         type:"post",  
  13.         url:"addComment!comment.action",  
  14.         dataType:"json",  
  15.         success: function aa(data) {  
  16.               alert(data[0].userId);  
  17.               alert(data[0].userName);  
  18.         }  
  19.     });  
  20. }  
  21.  
  22.  
  23.  
  24. //javascript/7012

回复 " jQuery中ajax和post处理json的不同"

这儿你可以回复上面这条便签

captcha