View Full Version : Getting URLS from XML
Snoozie
09-28-2005, 11:30 AM
Hi I need some help, Ive created an XML document which is being parsed fine by Javascript, but I cant work out how to have a URL as one of the elements and have it shown as a link when it is parsed.
Thanks
mark87
09-28-2005, 03:16 PM
I'm not quite sure how you are parsing the XML in javascript but this may help.
Just include a hyperlink when parsing - so for instance, you have XML data in an 'url' tag and you've set the variable 'theurl' to it, you could do something like this -
blah.innerHTML += "<a href='" + theurl + "'>" + theurl + "</a>"
Snoozie
09-28-2005, 04:38 PM
That works thanks!
Turns out my problem was i was using blah.innerText rather than blah.HTML
vBulletin® v3.8.2, Copyright ©2000-2012, Jelsoft Enterprises Ltd.