Infinity Scroll with dynamic items

1 reply · opened Jul 20, 2017

MmedugnoJul 20, 2017

I am not that great with JS but I created some code to pull info from an XML file and build out the <article> tags. It work great on the first (main page) but break on the portfolio-infinity-scroll-2.html. Here is the code (don’t laugh), I just change it i=n in the for statement or scroll page(s),

    

        var xhttp = new XMLHttpRequest();
        xhttp.onreadystatechange = function () {
            if (this.readyState == 4 && this.status == 200) {
                myFunction(this);
            }
        };
        xhttp.open("GET", "xml/photo_albums.xml", true);
        xhttp.send();

        function myFunction(xml) {

            var xmlDoc = xml.responseXML;
            var i;
            var grouping = xmlDoc.getElementsByTagName("grouping");
            for (i = 0; i " + folder +
                    "" + tag1 +
                    "&nbsp&nbsp " + tag2 +
                    "&nbsp&nbsp " + tag3 +
                    "&nbsp&nbsp " + tag4 +
                    "";
                } else {
                    itemlist += "" + folder +
                    "" + tag1 +
                    "&nbsp&nbsp " + tag2 +
                    "&nbsp&nbsp " + tag3 +
                    "&nbsp&nbsp " + tag4 +
                    "";
                }
            }
            document.getElementById("portfolio").innerHTML = itemlist;
        }

    

And my page URL: http://www.medugno.org/photo_albums.html
Again sorry about the horrible code, but I’m not a JS developer any help would be very much appreciated

SSemicolon WebSTAFFJul 22, 2017

Hello,

We have tried checking out your Website and we are seeing an error with the following line of Code:

var menuURL = navList[i].querySelector('a').href;

Please consider checking this out which should fix any further issues with your website.

Hope this Helps!

Let us know if we can help you with anything else or if you find any further issues.

Have the same question, or something new?

Sign in to the Canvas dashboard to reply or open your own topic. Canvas owners get direct help from the SemiColonWeb team.

Reply on the dashboard