Hendrik Söbbing
Hendrik Söbbing

Reputation: 142

How to parse AJAX response without loading resources?

I load a bunch of HTML from the server containing img-tags. I need to parse this response (I need only a small part of it) and find a few particular tags.

Problem is, as soon as I throw the response into jQuery to parse it, the browser loads all contained images. This is partly unnecessary (I don't need most of them), but the biggest problem is that they are loaded via HTTP in an SSL-environment.

Is there a way to parse an HTML-string without loading the contained images?

Upvotes: 0

Views: 436

Answers (1)

Josh K
Josh K

Reputation: 28883

You should be able to parse the response inside the return function.

$.get(url, data, function(html)
{
    // Parse here
});

Upvotes: 2

Related Questions