Infinity scroller error

7 years 11 months ago #7686 by Roddy
I'm using Joomla 3.5.1 and AjaxInfinity but I seem to be having problems getting it to work.

I've set up a blog and enabled the Infinity plugin. The pagination has disappeared from the bottom of the page as expected but a single 'Next' link remains. Clicking on this link takes me to the next set of results but with no CSS formatting or title/menu/footer etc.

There appears to be a jquery error on the blog page when the infinity plugin loads:
test:41 Uncaught TypeError: jQuery(...).tooltip is not a function
<script src="/plugins/system/ajaxinfinity/jquery.query-object.min.js" type="text/javascript"></script>
  <script src="/plugins/system/ajaxinfinity/script.js" type="text/javascript"></script>
  <script src="http://code.jquery.com/jquery-latest.min.js" type="text/javascript"></script>
  <script type="text/javascript">
jQuery(document).ready(function(){

ERROR HERE	jQuery('.hasTooltip').tooltip({"html": true,"container": "body"});

});
            jQuery(document).ready(function($) {
                $(".blog").hashRedirect({
                    start: $.query.get("start"),
                    containerSelector: ".blog",
                    loadingHtml: '<div class="ai-loading clearfix"><img src="/plugins/system/ajaxinfinity/loading.gif" /></div>'
                });
                $.ajaxSetup ({
                    cache: false
                });
                //var aligned = false;
                $(".blog").jscroll({
                    padding: 0,
                    nextSelector: "a.ai-next",
                    loadingHtml: '<div class="ai-loading clearfix"><img src="/plugins/system/ajaxinfinity/loading.gif" /></div>',
                    autoTrigger: true,
                    autoTriggerUntil: 50,
                    callback: function() {
                        /*
                        if (!aligned) {
                            $(this).goToHash();
                            aligned = true;
                        }
                        */
                        var text = $(".ai-results").text();
                        if (text) {
                            var matches = text.match(/ ([0-9]+) - /);
                            if (matches) {
                                var start = parseInt(matches[1]);
                                var cnt = $(".items-row").length;
                                var to = start + cnt - 1;
                                text = text.replace(/ - [0-9]+ /, " - " + to + " ");
                                $(".ai-results").text(text);
                            }
                        }
                    }
                });
            });
        
  </script>

I'm not using tooltips anywhere on the page so I'm not sure how to go about fixing this. Can you help?

Many thanks

Please Log in or Create an account to join the conversation.

7 years 11 months ago #7687 by Saka
Hello,

Don't think it's my script calling the tooltips. If you deactivate AJAX Infinity do you still get the JS error?

Emir Sakic
www.sakic.net

Please Log in or Create an account to join the conversation.

7 years 11 months ago #7688 by Roddy
Yes, I still get the error if i disable the script so it seems it's not the infinity plugin. It doesn't seem to affect normal operation of the page either and there are no other errors on the page.
Any ideas why the infinity scroller doesn't appear?

Please Log in or Create an account to join the conversation.

7 years 11 months ago #7689 by Saka
It's sensitive for JS errors so please make sure you are clear of errors first.

Emir Sakic
www.sakic.net

Please Log in or Create an account to join the conversation.

7 years 11 months ago #7692 by Roddy
Hi Saka, I've resolved the tooltip JS error - the page couldn't see the JQuery library.

However, it is still not working - another JS error but this time right in the middle of the ajaxinfinity script:
test:45 Uncaught TypeError: Cannot read property 'get' of undefined
jQuery(document).ready(function(){
	jQuery('.hasTooltip').tooltip({"html": true,"container": "body"});
});
            jQuery(document).ready(function($) {
                $(".blog").hashRedirect({
ERROR HERE                    start: $.query.get("start"),
                    containerSelector: ".blog",
                    loadingHtml: '<div class="ai-loading clearfix"><img src="/plugins/system/ajaxinfinity/loading.gif" /></div>'
                });
                $.ajaxSetup ({
                    cache: false
                });
                //var aligned = false;
                $(".blog").jscroll({
                    padding: 0,
                    nextSelector: "a.ai-next",
                    loadingHtml: '<div class="ai-loading clearfix"><img src="/plugins/system/ajaxinfinity/loading.gif" /></div>',
                    autoTrigger: true,
                    autoTriggerUntil: 50,
                    callback: function() {
                        /*
                        if (!aligned) {
                            $(this).goToHash();
                            aligned = true;
                        }
                        */
                        var text = $(".ai-results").text();
                        if (text) {
                            var matches = text.match(/ ([0-9]+) - /);
                            if (matches) {
                                var start = parseInt(matches[1]);
                                var cnt = $(".items-row").length;
                                var to = start + cnt - 1;
                                text = text.replace(/ - [0-9]+ /, " - " + to + " ");
                                $(".ai-results").text(text);
                            }
                        }
                    }
                });
            });

Can you help?

Many thanks

Please Log in or Create an account to join the conversation.

7 years 11 months ago #7693 by Saka
I can't tell anything like this. Send me the access info including FTP and I will have a look.

Emir Sakic
www.sakic.net

Please Log in or Create an account to join the conversation.

About us

We provide high quality Joomla components created by a co-founder and original core developer of Joomla. For over a decade, our products have been used by more than 20.000 webmasters around the world.

Stay in touch