I need to find all a elements within .paginate and add a class to them.
I currently have:
$('#search_result').html('<span class="ajax-loader">Please wait ...</span>')
.load('/search/ajax-search',$("#search-panel").serialize())
.find('.paginate p a')
.addClass('click_paginate');
but no luck.
Here’s my HTML:
<div class="paginate clearfix">
<p>
<strong>1</strong>
<a href="/search/ajax-search/P20">2</a>
<a href="/search/ajax-search/P40">3</a>
<a href="/search/ajax-search/P20">></a>
<a href="/search/ajax-search/P280">Last ›</a>
</p>
</div>
You need to wait until the ajax load request finishes. You can do this by providing a complete callback.