Skip to content

Instantly share code, notes, and snippets.

@boldfacedesign
Created April 27, 2014 22:45
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save boldfacedesign/11357333 to your computer and use it in GitHub Desktop.
Save boldfacedesign/11357333 to your computer and use it in GitHub Desktop.
Shopify get all collection urls from sitemap
function loadXMLDoc(filename) {
if (window.XMLHttpRequest) {
xhttp=new XMLHttpRequest();
}
else {
xhttp=new ActiveXObject("Microsoft.XMLHTTP");
}
xhttp.open("GET",filename,false);
xhttp.send();
return xhttp.responseXML;
}
xmlDoc=loadXMLDoc("http://sitename.com/sitemap_collections_1.xml");
x=xmlDoc.getElementsByTagName("loc");
console.log(x)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment