Created
April 27, 2014 22:45
-
-
Save boldfacedesign/11357333 to your computer and use it in GitHub Desktop.
Shopify get all collection urls from sitemap
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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