I have the following code that gets the value of a drop down list and displays the value.php and valueb.php files in different divs. I already added a loading class, but I can't remo开发者_如何学JAVAve it when the page is loaded.
I tried .removeClass('loading')
before the end of statement with no result (when i add the removeclass, the pic is not loading).
The follow displays the loading pic onChange and stays showing. Thank you.
$('#result').empty().addClass('loading').load(val + '.php');
Try
$('#firstresult').empty().addClass('loading').load(val + '.php', function(){$('#firstresult').removeClass('loading'); });
精彩评论