Skip to content

Instantly share code, notes, and snippets.

@el3ment
Created May 15, 2014 17:22
Show Gist options
  • Save el3ment/6bc5e47d2e69570c1ab9 to your computer and use it in GitHub Desktop.
Save el3ment/6bc5e47d2e69570c1ab9 to your computer and use it in GitHub Desktop.
Create list of links from XML Sitemap
var html = "";
var links = [];
$('url loc').each(function(i, e){
links.push(e.innerHTML);
});
links.sort();
$(links).each(function(i, e){
html += "<li><a href='"+e+"'>"+e.replace("http://www.lonestarpercussion.com/", "").replace("/", " / ").replace(/\-/g, " ").replace(/ ?\/ ?$/,"")+"</a></li>";
});
$('urlset').html(html);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment