I’m developing tool to check status of all type of resources like js, css, img etc and other urls for given website.
For e.g. Given url: www.abc.com
Then I need to check status of all type of resources and urls for www.abc.com
For that I’m using jquery ajax… So as result, I will get html content of that url (abc.com)
But problem is how find all urls from that html content ? I tried lot of ways but can’t figure out how do I get.
Please provide someone some good solution for that.
Thanks in advance.
3
Answers
Try using
.each()
to iterateimg
,link
,script
elements ; retrievesrc
orhref
attribute valuesIf you want to get all “URLs” with pure JavaScript.
HTML:
JavaScript:
Demo: jsfiddle