0
我在我的腳本中使用jquery,並在此我調用該函數中使用setTimeout()函數。我也使用setTimeout()來調用該函數在document.ready(function(){})中;我得到了一個jQuery腳本不工作的錯誤,當我使用超時功能
當我運行這個腳本時,彈出錯誤信息爲「這個頁面上的腳本可能很忙,或者它可能已經停止響應了,你現在可以停止腳本,或者你可以繼續看腳本是否會完成」
我使用的功能
$(document).ready(function(){
setTimeout('reloadlink()', 1000);
setTimeout('randimage()', 2000);
});
function reloadlink(){
$.ajax({
type: "POST",
url: "<?php echo base_url();?>index.php/affliate/randomafflinks",
success: function(msg){
$('#rlinks').html(msg);
setTimeout('reloadlink()', 2000);
}
});
}
function randimage(){
$.ajax({
type: "POST",
url: "<?php echo base_url();?>index.php/affliate/randimage",
success: function(msg){
$('#affimg').html(msg);
setTimeout('randimage()', 2000);
}
});
}