我如何setTimeout
功能在這裏:setTimeout和jQuery的負載
function loadContent(url){
jQuery(".post").fadeTo(200,0.5);
jQuery("#container").load(href + ' .posts', function(responseHtml){
var newTitle = jQuery(responseHtml).filter('title').text();
document.title = newTitle;
});
}
我想是這樣的,但它不工作:
setTimeout(function(){
jQuery("#container").load(href + ' .posts', function(responseHtml){
var newTitle = jQuery(responseHtml).filter('title').text();
document.title = newTitle;
});
}, 1000);
我沒有得到任何錯誤。
是什麼'?href'它在哪裏定義?並可以從控制檯發佈錯誤.. –
href的定義如上href = jQuery(this).attr(「href」); 這裏是所有代碼http://pastebin.com/53yN5Esj,並沒有任何錯誤 – user1405674