y0umer
  1. $(function() { 
  2.     $(\'#submit\').bind(\'click\'function() { 
  3.  
  4.         var formData = $(\'#ajaxForm\').serialize(); 
  5.         //.serialize() 方法创建以标准 URL 编码表示的文本字符串 
  6.       
  7.         $.ajax({ 
  8.             type : "POST"
  9.             url  : "form.php",  
  10.             cache : false
  11.             data : formData, 
  12.             success : onSuccess, 
  13.             error : onError 
  14.         }); 
  15.         return false
  16.     }); 
  17. }); 
  18.  
  19. function onSuccess(data,status){ 
  20.     data = $.trim(data); //去掉前后空格 
  21.     $(\'#notification\').text(data); 
  22.  
  23. function onError(data,status){ 
  24.     //进行错误处理 

分类:

技术点:

相关文章:

  • 2022-12-23
  • 2021-11-19
  • 2021-12-14
  • 2021-11-13
猜你喜欢
  • 2022-12-23
  • 2021-11-27
  • 2021-12-23
  • 2022-12-23
  • 2021-06-15
  • 2021-12-10
相关资源
相似解决方案