最新消息: 新版网站上线了!!!

php ajax json post提交的方法

  1. $('#save').click(function() { 
  2.   var tmp = JSON.stringify($('.dd').nestable('serialize')); 
  3.   // tmp value: [{"id":21,"children":[{"id":196},{"id":195},{"id":49},{"id":194}]},{"id":29,"children":[{"id":184},{"id":152}]},...] 
  4.   $.ajax({ 
  5.     type: 'POST'
  6.     url: 'save_categories.php'
  7.     data: {'categories': tmp}, 
  8.     success: function(msg) { 
  9.       alert(msg); 
  10.     } 
  11.   }); 
  12. }); 

 

转载请注明:谷谷点程序 » php ajax json post提交的方法