gistfile1.txt var tname;var temp = 0;function obtain(photoid,addaction){//alert(addaction)if(temp == 0){temp = 1;var photoStyle=document.getElementById(photoid);$.ajax({url:addaction,type:"post",async:false,success:function(data){if(data==0
var tname; var temp = 0; function obtain(photoid,addaction){ //alert(addaction) if(temp == 0){ temp = 1; var photoStyle=document.getElementById(photoid); $.ajax({ url:addaction, type:"post", async:false, success:function(data){ if(data==0){ photoStyle.style.display="none"; window.clearInterval(tname); } temp = 0; } }); } } function loadGif(photoid,addaction) { //设置定时器所调用函数的参数 var mySetInterval = setInterval; window.setInterval = function(callback, interval) { var args = Array.prototype.slice.call(arguments, 2); function callFn(){callback.apply(null, args);} return mySetInterval(callFn, interval); } //设置图片的的属性(隐藏/显示) document.getElementById(photoid).style.display="block"; tname=window.setInterval(obtain,500,photoid,addaction); }