Quantcast
Channel: get image out of CDATA and description tag with jquery - Stack Overflow
Viewing all articles
Browse latest Browse all 3

get image out of CDATA and description tag with jquery

$
0
0

How do i get a image out of a CDATA and description tag?Here is the XML code:

<description><![CDATA[<img src='http://www.autowereld.com/imagesDB/100/311151018460_.jpg' border='0'                     bordercolor='black' style='float:left; margin-right: 8px;margin-bottom: 8px;'>    ]]>    Het is Subaru wat de klok slaat deze week. Na spyshots van de Subaru Legacy Touring,     gelekte foto’s van de productierijpe WRX en de officiële bekendmaking van de Legacy Concept is     het nu tijd voor de Crossover 7 Concept.</description>

This is what i got:

var img = $(element).find("description").text();img = img.replace("<![CDATA[", "").replace("]]>", "");console.log(img);$("#img").append('<img src="'+ img +'">');

Viewing all articles
Browse latest Browse all 3

Latest Images

Trending Articles





Latest Images