Forum Moderators: open
Im having trouble trying to write a script that reads a body of text and replaces image names with the actual images. So for example the script could read this body of text and replace this tag <apple.jpg> with the actual image file stored in a separate folder on my PC
Have searched thoroughly online and cannot find any existing javascript examples. All help greatly appreciated.
Stefan
I would need to know how to retrieve full text to parse ...
document.getElementsByTagName('body').innerHTML var FullText=document.getElementsByTagName('body')[0].innerHTML ;
var PictString="\<apple.jpg\>"
var PicCode="\<img src='apple.jpg' /\>"
var WithPics= FullText.replace(/PicString/g,PicCode)
document.getElementsByTagName('body')[0].innerHTML =WithPics