I have This code for load content in comment-list
div
for pagination using jQuery delegate
:
JS :
<script type="text/javascript">
$('#comment-list .pagination a').delegate('click', function() {
$('#comment-list').fadeOut('slow');
$('#comment-list').load(this.href);
$('#comment-list').fadeIn('slow');
return false;
});
$('#comment-list').load('index.php?route=simple_blog/article/comment&simple_blog_article_id=<?php echo $simple_blog_article_id; ?>');
</script>
HTML :
<div id="comment-list">
<div class="pagination">
<div class="links">
<b>1</b>
<a href="http://localhost/oc/index.php?route=simple_blog/article/comment&simple_blog_article_id=5&page=2">2</a>
<a href="http://localhost/oc/index.php?route=simple_blog/article/comment&simple_blog_article_id=5&page=3">3</a>
<a href="http://localhost/oc/index.php?route=simple_blog/article/comment&simple_blog_article_id=5&page=2">></a>
<a href="http://localhost/oc/index.php?route=simple_blog/article/comment&simple_blog_article_id=5&page=3">>|</a> </div><div class="results">Showing 1 to 5 of 11 (3 Pages)
</div>
</div>
</div>
But In action My code not work and not load content in div
. after click in pagination link, I see open new window and load my content. I test my code in jQuery 2.1.1
Version and I think delegate
not work in jQuery 2.1.1
.
How do fix my problem?