I am making an ajax call to get more results and get them appended to the existing ones in the same page. While the contents are fetched, i need to show a scrolling spinner every time requests are send. In order to achieve this i go on adding a div at bottom of results fetched like this:
<div class="loader" style="display:block"></div>
And i am trying to show the spinner using the below code:
beforeSend: function()
{
$('#loader:last-child').html('<img src="/graphics/loading.gif" alt="Wait" />');
}
complete: function()
{
$('#loader:last-child').html('');
}
But i am not able to get the spinner effect, it is not at all shown on the page(results are though fetched).
Please help me in getting it corrected. Any other thoughts to have the spinner effect are also appreciated.
EDIT: I have removed quotes as they wre in my perl code. sorry for that.