I have a RSS feed that I’m reading into a file with PHP which is passed to javascript thru AJAX. I’m having a problem with characters such as “<” which in XML would read “<”. I’ve tried the .replace method but it does not do anything to the string. My javascript is below:
[CODE]
//get the string of the desc
var desc = items.getElementsByTagName(‘description’)[0].firstChild.data;
// desc looks like: “<b>Some bold text</b>”
var newDesc = desc.replace(/</g,”<“).replace(/>/g,”>”);
The above code does not effect the string in the slightest, and if you view source on the page that this string ends up in, you will see the < and >
Can anyone see where I might be going wrong with this?
Thanks in advance,
Greg