Plugin

Developer
Supported

Infinite Scroll

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.

ReferenceError: infiniteScrollData1 is not defined

Bug Report

Ralph
Ralph

Hi

I’m getting a the javascript error ReferenceError: infiniteScrollData1 is not defined when using infinite_scroll_values. It works fine when I don’t have infinite_scroll_values/infinite_scroll_vars defines but when I added them in I get that javascript error and it doesn’t show any entries. I’m using Structure and Freebie (freebie_3 is similar to segment_3). If you could shed some light on what I’m doing wrong that would be great. Template code is below:

pages/news_listing:

{embed="layouts/standard-layout"}

{exp
:stash:page_content} 
{exp
:channel:entries}
{embed
="includes/set_css_background" image="{page_image}"}
<div class="standard-page-top-image" style="background-image:url(/images/news-listing-header.jpg);">
 <
div class="dropdown-panel">
  <
div class="pure-g">
   <
div class="pure-u-1 pure-u-md-1-2 d-p-title-wrap">
    <
h1>{title}</h1>
   </
div>
   <
div class="pure-u-1 pure-u-md-1-2 d-p-select-wrap">
    <
div class="dropdown-select">
     <
select  class="link-dropdown">
      <
option value="/{segment_1}/{segment_2}">{exp:transcribe:replace name="Show All"}</option>
      
{exp:channel:categories category_group="1"}
      
<option value="/{segment_1}/category/{category_id}" {if freebie_3==category_id}selected{/if}>
       
{exp:transcribe:replace name="{category_name}"}
      
</option>
      
{/exp:channel:categories}
     
</select>
    </
div>
   </
div>
  </
div>
 </
div>
</
div>

{/exp:channel:entries}
<div class="pure-g">
 <
ul class="standard-entry-list">      

 
{embed="includes/infinite_scroll_news" infinite_scroll_vars="cat" infinite_scroll_values="{freebie_3}"}
 
</ul>
</
div>
{/exp:stash:page_content} 

includes/infinite_scroll_news:

{exp:infinite_scroll:wrapper ajax_container="ajax_container" embed_template_url="{homepage}includes/infinite_scroll_news" xid_element_id="infinite_scroll_xid" process_indicator="process_indicator" parse="inward"  infinite_scroll_values="{embed:infinite_scroll_values}" infinite_scroll_vars="{embed:infinite_scroll_vars}" }

{infinite_scroll_container_top}
<div id="ajax_container">
 
{/infinite_scroll_container_top}


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

 
{exp:channel:entries channel="news_article" category="{infinite_scroll_embed_cat}" dynamic="no" limit="5" paginate="bottom" parse="inward"}
 
<a href="{page_url}">
  <
li class="pure-u-1 pure-u-md-1-2 s-e-l-item">
   <
div class="pure-g standard-wrap">
    <
div class="pure-u-1 pure-u-xl-1-2 standard-inner-wrap">
     <
div class="standard-inner text">

      <
h2>{absolute_count}{title} </h2>
      <
class="article-date">{entry_date format="%d%S %F %Y"}</p>
      <
p>{exp:snippet total="500" word="true" ellipsis="..."}{page_main_content}{/exp:snippet} </p>
      <
span class="button">More</span>
     </
div>
    </
div>      
    <
div class="pure-u-1 pure-u-xl-1-2 standard-inner-image" style="background-image:url({exp:ed_imageresizer image='{page_listing_image}' maxWidth='1200'  href_only='yes'});"></div>
   </
div>
  </
li>

 </
a>
 
{paginate}
 {if next_page}
 
<div class="process_indicator">
  
Loading…
 
</div>
 
{exp:infinite_scroll:next_chunk_data}{auto_path}{/exp:infinite_scroll:next_chunk_data}
 {
/if}
 {
/paginate}


 {
/exp:channel:entries}


 {infinite_scroll_container_bottom}
</div><!-- End of # ajax_container -->
{/infinite_scroll_container_bottom}

{
/exp:infinite_scroll:wrapper}