<?xml version="1.0" encoding="utf-8"?>
<rdf:RDF xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:dc = "http://purl.org/dc/elements/1.1/" xmlns="http://purl.org/rss/1.0/">
	<channel rdf:about="http://livedocs.adobe.com/">
	<title>LiveDocs Comments - coldfusion - 7 - htmldocs - 00000543.htm</title>	
		<link>http://livedocs.adobe.com/</link>
		<description>Macromedia LiveDocs - online documentation with user feedback.</description>
		<copyright>Copyright 2009, Macromedia, Inc.</copyright>
		<dc:date>2009-11-25T21:38:44</dc:date>
		<dc:language>en-us</dc:language>
		<items>
			<rdf:Seq>
				<rdf:li rdf:resource="http://livedocs.adobe.com/coldfusion/7/htmldocs/00000543.htm#33982" />
				<rdf:li rdf:resource="http://livedocs.adobe.com/coldfusion/7/htmldocs/00000543.htm#33938" />
			</rdf:Seq>
		</items>
	</channel>
	
	<item rdf:about="http://livedocs.adobe.com/coldfusion/7/htmldocs/00000543.htm#33982">
		<title>coldfusion/7/htmldocs/00000543.htm</title>
		<link>http://livedocs.adobe.com/coldfusion/7/htmldocs/00000543.htm#33982</link>
		<description>How about making &quot;A string that is safe to use with JavaScript.&quot; more precise? Something like:&lt;br /&gt;&lt;br /&gt;&quot;A String that is safe to use within a JavaScript literal string.&quot;&lt;br /&gt;&lt;br /&gt;That means that all chars that could end a JavaScript literal string are escaped, for example single and double quotes. &lt;br /&gt;&lt;br /&gt;I propose extending JSStringFormat: The chars &quot;&lt;/script&gt;&quot; are acceptable within a literal string, but are not safe. Example:&lt;br /&gt;&lt;cfscript&gt;&lt;br /&gt;	x = &quot;&lt;/script&gt;&lt;script&gt;alert(document.cookie)&lt;/script&gt;&quot;;&lt;br /&gt;	x = JSStringFormat(x);&lt;br /&gt;&lt;/cfscript&gt;&lt;br /&gt;&lt;cfoutput&gt;&lt;br /&gt;&lt;script&gt;alert(&quot;Hola #x#&quot;)&lt;/script&gt;&lt;br /&gt;&lt;br /&gt;Resulting html:&lt;br /&gt;&lt;script&gt;alert(&quot;Hola&lt;/script&gt;&lt;script&gt;alert(document.cookie)&lt;/script&gt;&quot;)&lt;/script&gt;&lt;br /&gt;&lt;br /&gt;Other html tags can be used too. I propose that JSStringFormat additionally substitute '&lt;' by '\u003C'.&lt;br /&gt;&lt;br /&gt;I also propose giving the complete list of substitutions that JSStringFormat does on this page, as there was in the livedocs for ColdFusion 6.0 version.</description>
		<dc:creator>Alexander Bunkenburg</dc:creator>
		<dc:type>0 0</dc:type>
		<dc:date>2005-05-26T01:52:09</dc:date>
	</item>
	<item rdf:about="http://livedocs.adobe.com/coldfusion/7/htmldocs/00000543.htm#33938">
		<title>coldfusion/7/htmldocs/00000543.htm</title>
		<link>http://livedocs.adobe.com/coldfusion/7/htmldocs/00000543.htm#33938</link>
		<description>The example is slightly off.&lt;br /&gt;A tab is chr (9), backspace is chr(8).&lt;br /&gt;&lt;br /&gt;This might be a better example:&lt;br /&gt;&lt;!--- This example shows the use of the JSStringFormat function. ----&gt;&lt;br /&gt;&lt;CFOUTPUT&gt;&lt;br /&gt;    &lt;h3&gt;JSStringFormat&lt;/h3&gt;&lt;br /&gt;    &lt;cfset stringValue = &quot;An example string value with a tab#chr(9)# chr(9),&lt;br /&gt;    a newline#chr(10)# (chr10) and some &quot;&quot;quoted&quot;&quot; 'text'&quot;&gt;&lt;br /&gt;&lt;br /&gt;    &lt;p&gt;&lt;br /&gt;        This is the string we have created:&lt;br&gt;&lt;br /&gt;        #stringValue#&lt;br /&gt;    &lt;/p&gt;&lt;br /&gt;    &lt;p&gt;&lt;br /&gt;        View the HTML source to verofy that the control characters are indeed there.&lt;br /&gt;    &lt;/p&gt;&lt;br /&gt;&lt;br /&gt;    &lt;cfset jsStringValue = JSStringFormat (#stringValue#)&gt;&lt;br /&gt;&lt;br /&gt;    &lt;!----- Generate an alert from the JavaScript string jsStringValue. ----&gt;&lt;br /&gt;    &lt;SCRIPT&gt;&lt;br /&gt;        s = &quot;#jsStringValue#&quot;;&lt;br /&gt;        alert (s);&lt;br /&gt;    &lt;/SCRIPT&gt;&lt;br /&gt;&lt;/CFOUTPUT&gt;</description>
		<dc:creator>MikerRoo</dc:creator>
		<dc:type>0 0</dc:type>
		<dc:date>2005-05-24T20:05:25</dc:date>
	</item>
	</rdf:RDF>

