• Create BookmarkCreate Bookmark
  • Create Note or TagCreate Note or Tag
  • PrintPrint

Name

JSStringFormat

Synopsis

                    JSStringFormat(string)

Returns string with special characters escaped so that it is safe to use in JavaScript statements. Example:

<cfset MyString="""Escape double quotes"".  Escape the \ character. 'Escape 
single quotes'">
   
<cfset SafeString=JSStringFormat(MyString)>
   
<cfoutput>
<b>Original String:</b> #MyString#<br>
<b>JavaScript Safe String:</b> #SafeString#
</cfoutput>


PREVIEW

                                                                          

Not a subscriber?

Start A Free Trial


  
  • Creative Edge
  • Create BookmarkCreate Bookmark
  • Create Note or TagCreate Note or Tag
  • PrintPrint