View Single Post
Old 10-08-2012, 05:46 PM   PM User | #6
WolfShade
Regular Coder

 
Join Date: Apr 2012
Location: St. Louis, MO, USA
Posts: 941
Thanks: 7
Thanked 95 Times in 95 Posts
WolfShade is an unknown quantity at this point
Quote:
Originally Posted by alphamale View Post
string.replace(/\<(\/)*pre\>/g,"")

I dont get this, what are all the special characters for? Does it just remove all <pre> and </pre> tags?

and for: inputID.value = "<pre>" + inputID.value + "</pre>"

could I use $newText = "<pre>"".$oldText."</pre>";
?

Thanks!
I haven't tested it (not enough time, at work), but the extra characters (I assume you mean the backslashes) are for escaping, making the <, /, and > characters "literals" instead of programming commands.

It _should_ just remove the "<pre>" and "</pre>" tags from the string.

As far as $newText and whatnot, that looks like PHP, not JavaScript.
__________________
^_^

If anyone knows of a website that can offer ColdFusion help that isn't controlled by neurotic, pedantic jerks* (stackoverflow.com), please PM me with a link.
*
The neurotic, pedantic jerks are not the owners; just the people who are in control of the "popularity contest".
WolfShade is offline   Reply With Quote