Jquery ajax implement with timer

Ajax exmaple from w3schooljavascript

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

  time in jquery mark button disablehtml

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

(function(){
$('button').on('click',function(){
	var $this=$(this);
   $this
         .attr('disabled','disabled');
          setTimeout(function() {
            $this.removeAttr('disabled');
        }, 3000);
});
})();
相關文章
相關標籤/搜索