P
ROTOTYPE
I'm Not Only The Prototype, I'm Also A Member.
home
▪
stats
▪
search
▪
linkback
▪
about
▪
FAQ
| user: guest,
login
,
register
Textfield
:
htmlText consecutive tag bug
author:
persist
[+]
,
Submitted: 03.18.03 7a
String.prototype.htmlSpaceFix = function(){ var fix = this; fix = fix.split("> "); fix = fix.join("> "); return fix; }
usage
try this: output = ("<b>This is an html bug fix</b> <i>A</i>"); You'll lose the space between consecutive tags. you can fix it by moving the space inside one of the tags like so: output = ("<b>This is an html bug fix</b><i> A</i>"); But that's crappy. Here is the function fixing the immediate space after a close bracket. somestring = ("<b>This is an html bug fix</b> <i>for everyone.</i>"); String.prototype.htmlSpaceFix = function(){ var fix = this; fix = fix.split("> "); fix = fix.join("> "); return fix; } mytextField.htmlText = somestring.htmlSpaceFix(); since all the html needs is some string in between consecutive brackets this will also fix an example with multiple spaces like: "<b>lots of spaces</b> <i>here</i>" by making it: "<b>lots of spaces</b>  <i>here</i>"
Add Comment
[+]
›opyleft 2001-2010. Layer51 is: Jaime Prado.
@