jQuery load wont fire callback
I have this function:
$("#menuwrap").fadeOut(300, function () {
$("#menuwrap").load(url, function () {
$("#menuwrap").fadeIn(300);
});
});
But the callback action for .load() wont fire. #menuwrap is stuck with an inline style="display:none".
Even an alert() be开发者_JAVA百科fore the fadeIn() won't show.
Never had this trouble before. Any ideas?
Checkout this jsfiddle. Try to check your URL for load() and it's content.
It was a script in the resulting HTML being loaded (AKA'url' var).
The script in said document was buggy, and therefore all further scripts (such as $("#menuwrap").fadeIn(300)) where not executed.
So, hide yo' wives, hide yo' daughters, double-check your asyncroncally loaded scripts.
加载中,请稍侯......
精彩评论