Jquery ajax implement with timer

Ajax exmaple from w3school

<script>
$(document).ready(function(){
  $("button").click(function(){
    $.ajax({url:"demo_test.txt",success:function(result){
      $("#div1").html(result);
    }});
  });
});
</script>

  time in jquery mark button disable

http://jsfiddle.net/informativejavascript/AMqb5/

(function(){
$('button').on('click',function(){
	var $this=$(this);
   $this
         .attr('disabled','disabled');
          setTimeout(function() {
            $this.removeAttr('disabled');
        }, 3000);
});
})();

  

 

posted @ 2014-03-08 00:37  MC_ED  阅读(245)  评论(0编辑  收藏  举报