码迷,mamicode.com
首页 > Web开发 > 详细

ajax访问

时间:2017-06-09 14:11:58      阅读:193      评论:0      收藏:0      [点我收藏+]

标签:method   port   attr   doc   res   show   disabled   pos   let   

$(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访问

标签:method   port   attr   doc   res   show   disabled   pos   let   

原文地址:http://www.cnblogs.com/tengfeihhh/p/6971540.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!