首页 > 代码库 > ajax访问

ajax访问

$(function(){
    $(#button1).click(function(){
         $.ajax({
             type: "POST",
             url: "eventlog.do",
             data: {methods:export},
             dataType: "json",
//访问之前的操作 beforeSend:function(){ $(
"loading").show(); $("#button1").attr({ disabled: "disabled" }); document.forms[0].submit(); },
//访问成功的回调函数
success: function(data){ alert(data+"success!"); },
//访问之后的操作
complete: function () { $("loading").hide(); alert("complete!!"); $("#button1").removeAttr("disabled"); }, }); }); });

 

ajax访问