Jeroen
Jeroen

Reputation: 137

get html from a div dont get the image tag

I have a mobile site in a sub directory of my regular site , the content for some pages i get from my regular site , this goes well i use this code :

$('.lastnews').load('/index-bestanden/news/news.html #newsmessage div:first');

in the original content are images , of course they appear on the mobile site as broken , what i want is to get the content without the images.

is that possible ? and how

so far i tried .note and .exclude , but cant get it working

thanks

Upvotes: 1

Views: 65

Answers (1)

Sampson
Sampson

Reputation: 268324

You can always select and remove their images:

$(".foo img").remove();

If we were to do this from the load callback, it would look like this:

$('.lastnews').load('...news.html #newsmessage div:first', function(){
  $(this).find("img").remove();
});

Upvotes: 3

Related Questions