Search code examples
javascriptjqueryhtmlimageget-request

Fetching external url images


I want to fetch the images[] array of an external URL. I was able to retrieve the actual source code of the page using $.ajax, but I don't know how to access the images. Thanks.


Solution

  • You could do something like

    var images = [];
    $(pagecode).find('img').each(function(){
       images.push( this.src );
    });