我如何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