I'm trying to get all URLs from a page using jQuery to call them later on using $.get()
. If they were on the same page as the script is included in, it would be no problem calling something like
var links = document.getElementsByTagName("a");
for(var i=0; i<links.length; i++) {
alert(links[i].href);
}
In this case I'd just use alert to check that the links were actually parsed. But how can I do the same thing with an URL that is not the current page? Any help would be appreciated. Maybe I'm missing something ridiculously simple but I am really stumped when it comes to anything JavaScript/JQuery related.