![]() |
Coldfusion strings
I'm using the following statement in javascript/coldfusion and need help:
function somefun() { var myText = <cfoutput>#editor.text#</cfoutput> } The problem is, I need to treat myText as a string, and the #editor.text# contains both " and ' characters.... how do I get around the problem of early string termination and such? Any help would be appreciated, thanks |
i have had similar problems when using WebDNA (tag based server side scripting language). I had to grep the variable before it was sent to the browser. Just use regular expressions to replace " with \" and ' with \'. you may not need to do both. it depends on what your wrapping the js var with ( var txt ="hi" or var txt ='hi' ).
|
| All times are GMT +1. The time now is 04:59 PM. |
Powered by vBulletin® Version 3.8.2
Copyright ©2000 - 2010, Jelsoft Enterprises Ltd.