我正在使用jQuery getJSON()
函数。这个函数可以毫无问题地获取数据。但有时等待,等待...我的加载栏在页面中央显示加载加载。因此jQuery ajax()
函数有一个超时变量。但是我想使用getJSON
函数。我认为我可以使用ajaxStart()
和ajaxStop()
函数。但是怎么做呢?
$('.loadingDiv')
.hide()
.ajaxStart(function() {
$(this).fadeIn();
setTimeout("throw '';",15000) //i used this but didn't work
setTimeout("return;",15000) //i used this but didn't work
setTimeout("abort();",15000) //i used this but didn't work.(Abort all ajax events)
})
.ajaxStop(function() {
$(this).fadeOut();
});
https://stackoverflow.com/questions/14238619
复制相似问题