I have an XML feed that im pulling via javascript and translating it into something more HTML friendly, but im caught up on how to translate carriage returns into an html br tag
I tried something like this
text = text.replace('\r','<br />');
to no avail..
Any ideas?
Javascript’s replace function only replaces the first occurence if you use a string as the matching criteria. To replace all you can use regex.
Try something like this
Hope this helps.