To completely cover the latter, if you need to emit a JS string containing a literal "</script>" within a HTML SCRIPT block, you manually split it and you're done. jsStringFormat will make ensure a CF string is safe for use as a JS string, according to the rules of the JS language. It doesn't (and can't) do anything for context-sensitive rules (embedded in a HTML SCRIPT block, embedded in a tag's event handler, etc). If you think there is a bug in the docs, you should enter a comment to that effect. However, I don't see how you can reasonably assume that jsStringFormat would do anything about context-sensitive rules.
Worth mentioning (for your comment) is that quotes cause a similar issue with jsStringFormatted embedded within HTML tag event handlers. You need to use htmlEditFormat (or whatever) to convert the JS to valid HTML, because that's the context it's used in. cheers, barneyb On Dec 31, 2007 3:50 PM, Brad Wood <[EMAIL PROTECTED]> wrote: > Naturally your examples do not error since you have demonstrated a > JavaScript string containing the text "</script>" which is not contained > within "real" script tags. My onus however, was not to prove that EVERY > arbitrary "</script>" embedded within a JS string in an HTML document > would error but rather the possibility of such errors were not an "edge > case". Your examples, while accurate, do not preclude the many ways JS > strings can and are contained within real script tags. > > Regardless of how you want to classify the behavior, these facts still > remain: > -- The CF Docs appear to only be accurate based on how tightly you > define "safe". > -- The Docs make no official note that the jsstringformat will NOT > produce a string which can safely be output within script tags in an > HTML page. > -- It is my opinion that this caveat is not obvious enough to assume > readers will consider it. > -- The CF docs are for public consumption, not for a super-elite ring of > CFer's who already have intimate knowledge of the language. > > Ahh... we have digressed far-- as usual. My original intent was not to > pick on the Docs, but to provoke open-minded discussion and elicit > examples of how other people had dealt with the topic. I'd say we've > beaten the former into the ground (as usual) but never touched the > latter. > > ~Brad > > ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~| Adobe® ColdFusion® 8 software 8 is the most important and dramatic release to date Get the Free Trial http://ad.doubleclick.net/clk;160198600;22374440;w Archive: http://www.houseoffusion.com/groups/CF-Talk/message.cfm/messageid:295612 Subscription: http://www.houseoffusion.com/groups/CF-Talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4

