Plugin

Developer
Supported

AJAX Pagination

ExpressionEngine 1.x, ExpressionEngine 2

Back to this add-on's main page
View Other Add-ons From Laisvunas

     

You must be logged in to post.

Uncaught ReferenceError: ajaxPagination1 is not defined

Support Request

mebner
mebner

I am using Ajax Pagination to paginate two separate channel:entries tags on one template. As I have it set up the two embed templates are pulling the content from the channels as expected and putting the content into their respective containers.

My problem is that the pagination links are not working at all. When I check the <a> of each pagination link the code shows

<a onclick="ajaxPagination1.fetchData('P3');">2</a

which seems correct as compared to the code shown in your example pages.

But I do get an error:

Uncaught ReferenceError: ajaxPagination1 is not defined

Here is my main template code:

<div id="news_releases">
 
{embed="probiotic-news/embed_ganeden_pr" ajax_pagination_vars="tag_count" ajax_pagination_values="1"}
</div>

<
div id="partner_news_releases">
 
{embed="probiotic-news/embed_partner_pr" ajax_pagination_vars="tag_count" ajax_pagination_values="2"}
</div

And here is my first embed template:

{exp:ajax_pagination:wrapper 
ajax_container
="ganeden_news_releases_list" 
embed_template_url="{site_url}index.php/probiotic-news/embed_ganeden_pr" 
xid_element_id="infinite_scroll_xid"
process_indicator="process_indicator" 
process_indicator_scroll="yes" 
parse="inward"
ajax_pagination_vars="{embed:ajax_pagination_vars}"
ajax_pagination_values="{embed:ajax_pagination_values}"
}

{ajax_pagination_container_top}
<ul id="ganeden_news_releases_list">
{/ajax_pagination_container_top}

<input type="hidden" id="infinite_scroll_xid" value="{XID_HASH}">

<
div class="process_indicator">
Loading…
</div>

{exp:channel:entries channel="news_releases" category="23" disable="member_data" limit="3" dynamic="off" paginate="bottom" parse="inward"}

<li>
 <
span class="nr_date">{entry_date format="%F %d, %Y"}</span><h3><a href="{path='probiotic-news/news_releases/{url_title}'}">{long_title}</a></h3>
 
{exp:word_limit total="30"}
  {news_body}
 {
/exp:word_limit}<a href="{path='probiotic-news/news_releases/{url_title}'}"More»</a>
</
li>

{paginate}{exp:ajax_pagination:links}{pagination_links}{/exp:ajax_pagination:links}{/paginate}

{
/exp:channel:entries}

{ajax_pagination_container_bottom}
</ul>
{/ajax_pagination_container_bottom}

{
/exp:ajax_pagination:wrapper} 

And here is my second embed template:

{exp:ajax_pagination:wrapper 
ajax_container
="partner_news_releases_list" 
embed_template_url="{site_url}index.php/probiotic-news/embed_partner_pr" 
xid_element_id="infinite_scroll_xid"
process_indicator="process_indicator" 
process_indicator_scroll="yes" 
parse="inward"
ajax_pagination_vars="{embed:ajax_pagination_vars}"
ajax_pagination_values="{embed:ajax_pagination_values}"
}

{ajax_pagination_container_top}
<ul id="partner_news_releases_list">
{/ajax_pagination_container_top}

<input type="hidden" id="infinite_scroll_xid" value="{XID_HASH}">

<
div class="process_indicator">
Loading…
</div>

{exp:channel:entries channel="news_releases" category="24" disable="member_data" limit="3" dynamic="off" paginate="bottom" parse="inward"}

<li>
 <
span class="nr_date">{entry_date format="%F %d, %Y"}</span><h3><a href="{path='probiotic-news/partner_news_releases/{url_title}'}">{long_title}</a></h3>
 
{exp:word_limit total="30"}
  {news_body}
 {
/exp:word_limit}<a href="{path='probiotic-news/partner_news_releases/{url_title}'}"More»</a>
</
li>

{paginate}{exp:ajax_pagination:links}{pagination_links}{/exp:ajax_pagination:links}{/paginate}

{
/exp:channel:entries}

{ajax_pagination_container_bottom}
</ul>
{/ajax_pagination_container_bottom}

{
/exp:ajax_pagination:wrapper} 

Any help is appreciated.

Thanks!