ajax

1:ajax--jquery:
保存数据到服务器,成功时显示信息。
$.ajax({
   type: "POST",
   url: "some.php",
   data: "name=John&location=Boston",
   success: function(msg){
     alert( "Data Saved: " + msg );
   }
});
2:ajax--jquery-easyui:
$('#formid').form({    
    url:...,    
    onSubmit: function(){    
        // do some check    
        // return false to prevent submit;    
    },    
    success:function(data){    
        alert(data);    
    }    
});    
// submit the form    
$('#formid').submit(); 

原文地址:https://www.cnblogs.com/ihanliu/p/4739723.html