escaping characters in Javascript.
Code Scenerio looks like this: Problem: sometimes the #EVENT_OBJECTIVE# variable contains quotes and apostrophies.When that happens I get a _javascript_ error.How do I make sure that the content in the #event_objective# is properly escaped. Dwayne Cole, MS in MIS, MBA Florida AM University Certified Advanced ColdFusion Developer 850-591-0212 [Todays Threads] [This Message] [Subscription] [Fast Unsubscribe] [User Settings]
Re: escaping characters in Javascript.
http://livedocs.macromedia.com/coldfusion/6.1/htmldocs/funct148.htm#wp110699 3 Massimo Foti Certified Dreamweaver MX Developer Certified Advanced ColdFusion MX Developer http://www.massimocorner.com/ [Todays Threads] [This Message] [Subscription] [Fast Unsubscribe] [User Settings]
Re: escaping characters in Javascript.
Works like a charm.Thanks. -- Original Message -- From: Massimo, Tiziana e Federica [EMAIL PROTECTED] Reply-To: [EMAIL PROTECTED] Date:Fri, 5 Dec 2003 11:09:43 +0100 http://livedocs.macromedia.com/coldfusion/6.1/htmldocs/funct148.htm#wp110699 3 Massimo Foti Certified Dreamweaver MX Developer Certified Advanced ColdFusion MX Developer http://www.massimocorner.com/ [Todays Threads] [This Message] [Subscription] [Fast Unsubscribe] [User Settings]
Escaping characters
Does anyone know how to escape charachters in SQL server - to be more specific I am buiding a string where I need to escape a double quote so the string isn't prematurely completed. __ Your ad could be here. Monies from ads go to support these lists and provide more resources for the community. http://www.fusionauthority.com/ads.cfm FAQ: http://www.thenetprofits.co.uk/coldfusion/faq Archives: http://www.mail-archive.com/cf-talk@houseoffusion.com/ Unsubscribe: http://www.houseoffusion.com/index.cfm?sidebar=lists
Re: Escaping characters
Does anyone know how to escape charachters in SQL server - to be more specific I am buiding a string where I need to escape a double quote so the string isn't prematurely completed. Unless you're using #preservesinglequotes()# around your variable, you shouldn't have to worry about escaping the single quotes -- ColdFusion's cfquery tag will do that for you... Isaac Dealey Certified Advanced ColdFusion 5 Developer www.turnkey.to 954-776-0046 __ Your ad could be here. Monies from ads go to support these lists and provide more resources for the community. http://www.fusionauthority.com/ads.cfm FAQ: http://www.thenetprofits.co.uk/coldfusion/faq Archives: http://www.mail-archive.com/cf-talk@houseoffusion.com/ Unsubscribe: http://www.houseoffusion.com/index.cfm?sidebar=lists
Re: Escaping characters
Unless you also use a trim or other function at the same time. I seem to remember that it then doen't do the escaping for you then, either. Jerry Johnson [EMAIL PROTECTED] 08/29/02 01:49PM Does anyone know how to escape charachters in SQL server - to be more specific I am buiding a string where I need to escape a double quote so the string isn't prematurely completed. Unless you're using #preservesinglequotes()# around your variable, you shouldn't have to worry about escaping the single quotes -- ColdFusion's cfquery tag will do that for you... Isaac Dealey Certified Advanced ColdFusion 5 Developer www.turnkey.to 954-776-0046 __ Signup for the Fusion Authority news alert and keep up with the latest news in ColdFusion and related topics. http://www.fusionauthority.com/signup.cfm FAQ: http://www.thenetprofits.co.uk/coldfusion/faq Archives: http://www.mail-archive.com/cf-talk@houseoffusion.com/ Unsubscribe: http://www.houseoffusion.com/index.cfm?sidebar=lists
Re: Escaping characters
Unless you also use a trim or other function at the same time. I seem to remember that it then doen't do the escaping for you then, either. I've not had any problems with using trim() ... Older version maybe? Jerry Johnson [EMAIL PROTECTED] 08/29/02 01:49PM Does anyone know how to escape charachters in SQL server - to be more specific I am buiding a string where I need to escape a double quote so the string isn't prematurely completed. Unless you're using #preservesinglequotes()# around your variable, you shouldn't have to worry about escaping the single quotes -- ColdFusion's cfquery tag will do that for you... Isaac Dealey Certified Advanced ColdFusion 5 Developer www.turnkey.to 954-776-0046 __ Signup for the Fusion Authority news alert and keep up with the latest news in ColdFusion and related topics. http://www.fusionauthority.com/signup.cfm FAQ: http://www.thenetprofits.co.uk/coldfusion/faq Archives: http://www.mail-archive.com/cf-talk@houseoffusion.com/ Unsubscribe: http://www.houseoffusion.com/index.cfm?sidebar=lists Isaac Certified Advanced ColdFusion 5 Developer www.turnkey.to 954-776-0046 __ Your ad could be here. Monies from ads go to support these lists and provide more resources for the community. http://www.fusionauthority.com/ads.cfm FAQ: http://www.thenetprofits.co.uk/coldfusion/faq Archives: http://www.mail-archive.com/cf-talk@houseoffusion.com/ Unsubscribe: http://www.houseoffusion.com/index.cfm?sidebar=lists
escaping characters
My situation is this: (please help) I am pulling in an XML document through WDDX and assigning the result of a particular fieldname to an element within my two-dimensional array (all the data that is generated is dynamic - no way to hardcode the escaping character). cfset arrClip[#counter#][5] = #SOURCETAPENUMBER# When trying to do this i get an Unknown exception error. So i conducted a little test to see if i could get around this, but using the Replace function. cfset SOURCETAPENUMBER = CR#1-12 !--- which is dynamic, but for example purposes, hardcoded.--- cfset temp = Replace(SOURCETAPENUMBER,#,##,ALL) Invalid parser construct found on line 10 at position 18. ColdFusion was looking at the following text: 1 The error seems to arise from just the declaration of the of the string (CR#1-12) to the variable (SOURCETAPENUMBER). Need some sound advice. Is there a custom tag that will escape all CF special characters? or a different way to handle this situation. Thanks for any help. Dan __ Daniel Spindler Senior Web Architect Michael J. Motto Internet, L.L.C. www.mjmi.com (908)665-2500 ext. 138 __ Your ad could be here. Monies from ads go to support these lists and provide more resources for the community. http://www.fusionauthority.com/ads.cfm FAQ: http://www.thenetprofits.co.uk/coldfusion/faq Archives: http://www.mail-archive.com/cf-talk@houseoffusion.com/ Unsubscribe: http://www.houseoffusion.com/index.cfm?sidebar=lists
Re: escaping characters
Why not just do cfset SOURCETAPENUMBER = CR##1-12 Success is a journey, not a destination!! Doug Brown - Original Message - From: Jeffrey Bonnell [EMAIL PROTECTED] To: CF-Talk [EMAIL PROTECTED] Sent: Thursday, April 11, 2002 9:05 AM Subject: escaping characters My situation is this: (please help) I am pulling in an XML document through WDDX and assigning the result of a particular fieldname to an element within my two-dimensional array (all the data that is generated is dynamic - no way to hardcode the escaping character). cfset arrClip[#counter#][5] = #SOURCETAPENUMBER# When trying to do this i get an Unknown exception error. So i conducted a little test to see if i could get around this, but using the Replace function. cfset SOURCETAPENUMBER = CR#1-12 !--- which is dynamic, but for example purposes, hardcoded.--- cfset temp = Replace(SOURCETAPENUMBER,#,##,ALL) Invalid parser construct found on line 10 at position 18. ColdFusion was looking at the following text: 1 The error seems to arise from just the declaration of the of the string (CR#1-12) to the variable (SOURCETAPENUMBER). Need some sound advice. Is there a custom tag that will escape all CF special characters? or a different way to handle this situation. Thanks for any help. Dan __ Daniel Spindler Senior Web Architect Michael J. Motto Internet, L.L.C. www.mjmi.com (908)665-2500 ext. 138 __ Structure your ColdFusion code with Fusebox. Get the official book at http://www.fusionauthority.com/bkinfo.cfm FAQ: http://www.thenetprofits.co.uk/coldfusion/faq Archives: http://www.mail-archive.com/cf-talk@houseoffusion.com/ Unsubscribe: http://www.houseoffusion.com/index.cfm?sidebar=lists
RE: escaping characters
This is a test i did where a put a string with #'s in a text file and them read the text file into a variable, much like you are doing with a query. the only thing that is different is that i escaped the #'s inside the replacenocase function. See if this helps you out. test.txt This is # a # test ## index.cfm == cffile action=READ file=C:\Inetpub\wwwroot\test\test.txt variable=myXML cfoutput#myXML#/cfoutputbr cfoutput#ReplaceNoCase(myXML, ##, , ALL)#/cfoutput Resulting Output This is # a # test ## This is ## a ## test Anthony Petruzzi Webmaster 954-321-4703 [EMAIL PROTECTED] http://www.sheriff.org -Original Message- From: Douglas Brown [mailto:[EMAIL PROTECTED]] Sent: Thursday, April 11, 2002 12:15 PM To: CF-Talk Subject: Re: escaping characters Why not just do cfset SOURCETAPENUMBER = CR##1-12 Success is a journey, not a destination!! Doug Brown - Original Message - From: Jeffrey Bonnell [EMAIL PROTECTED] To: CF-Talk [EMAIL PROTECTED] Sent: Thursday, April 11, 2002 9:05 AM Subject: escaping characters My situation is this: (please help) I am pulling in an XML document through WDDX and assigning the result of a particular fieldname to an element within my two-dimensional array (all the data that is generated is dynamic - no way to hardcode the escaping character). cfset arrClip[#counter#][5] = #SOURCETAPENUMBER# When trying to do this i get an Unknown exception error. So i conducted a little test to see if i could get around this, but using the Replace function. cfset SOURCETAPENUMBER = CR#1-12 !--- which is dynamic, but for example purposes, hardcoded.--- cfset temp = Replace(SOURCETAPENUMBER,#,##,ALL) Invalid parser construct found on line 10 at position 18. ColdFusion was looking at the following text: 1 The error seems to arise from just the declaration of the of the string (CR#1-12) to the variable (SOURCETAPENUMBER). Need some sound advice. Is there a custom tag that will escape all CF special characters? or a different way to handle this situation. Thanks for any help. Dan __ Daniel Spindler Senior Web Architect Michael J. Motto Internet, L.L.C. www.mjmi.com (908)665-2500 ext. 138 __ Structure your ColdFusion code with Fusebox. Get the official book at http://www.fusionauthority.com/bkinfo.cfm FAQ: http://www.thenetprofits.co.uk/coldfusion/faq Archives: http://www.mail-archive.com/cf-talk@houseoffusion.com/ Unsubscribe: http://www.houseoffusion.com/index.cfm?sidebar=lists
Escaping characters
Earlier Ben Forta told me that to escape a character like in: cfset variables.test = ReplaceNoCase(variables.testVar, TD bgcolor=#ff width=1, new code , ALL) that I needed to change #FF to ##FF so it doesn't think it is a variable. Now I am trying to replace table width=640 How do I work around the quotes? Thanks, Jim Vosika __ Dedicated Windows 2000 Server PIII 800 / 256 MB RAM / 40 GB HD / 20 GB MO/XFER Instant Activation · $99/Month · Free Setup http://www.pennyhost.com/redirect.cfm?adcode=coldfusiona FAQ: http://www.thenetprofits.co.uk/coldfusion/faq Archives: http://www.mail-archive.com/cf-talk@houseoffusion.com/ Unsubscribe: http://www.houseoffusion.com/index.cfm?sidebar=lists
Re: Escaping characters
Same way ... double quotes 640 Paul Giesenhagen QuillDesign http://www.quilldesign.com SiteDirector - Commerce Builder - Original Message - From: Jim Vosika [EMAIL PROTECTED] To: CF-Talk [EMAIL PROTECTED] Sent: Sunday, February 10, 2002 10:34 PM Subject: Escaping characters Earlier Ben Forta told me that to escape a character like in: cfset variables.test = ReplaceNoCase(variables.testVar, TD bgcolor=#ff width=1, new code , ALL) that I needed to change #FF to ##FF so it doesn't think it is a variable. Now I am trying to replace table width=640 How do I work around the quotes? Thanks, Jim Vosika __ Dedicated Windows 2000 Server PIII 800 / 256 MB RAM / 40 GB HD / 20 GB MO/XFER Instant Activation · $99/Month · Free Setup http://www.pennyhost.com/redirect.cfm?adcode=coldfusiona FAQ: http://www.thenetprofits.co.uk/coldfusion/faq Archives: http://www.mail-archive.com/cf-talk@houseoffusion.com/ Unsubscribe: http://www.houseoffusion.com/index.cfm?sidebar=lists
RE: Escaping characters
use two s as in table width=640 -Original Message- From: Jim Vosika [mailto:[EMAIL PROTECTED]] Sent: Sunday, February 10, 2002 11:35 PM To: CF-Talk Subject: Escaping characters Earlier Ben Forta told me that to escape a character like in: cfset variables.test = ReplaceNoCase(variables.testVar, TD bgcolor=#ff width=1, new code , ALL) that I needed to change #FF to ##FF so it doesn't think it is a variable. Now I am trying to replace table width=640 How do I work around the quotes? Thanks, Jim Vosika __ Get Your Own Dedicated Windows 2000 Server PIII 800 / 256 MB RAM / 40 GB HD / 20 GB MO/XFER Instant Activation · $99/Month · Free Setup http://www.pennyhost.com/redirect.cfm?adcode=coldfusionb FAQ: http://www.thenetprofits.co.uk/coldfusion/faq Archives: http://www.mail-archive.com/cf-talk@houseoffusion.com/ Unsubscribe: http://www.houseoffusion.com/index.cfm?sidebar=lists
RE: Escaping characters
I guess I dont really understand why works as well as why ## works but thanks!! use two s as in table width=640 -Original Message- From: Jim Vosika [mailto:[EMAIL PROTECTED]] Sent: Sunday, February 10, 2002 11:35 PM To: CF-Talk Subject: Escaping characters Earlier Ben Forta told me that to escape a character like in: cfset variables.test = ReplaceNoCase(variables.testVar, TD bgcolor=#ff width=1, new code , ALL) that I needed to change #FF to ##FF so it doesn't think it is a variable. Now I am trying to replace table width=640 How do I work around the quotes? Thanks, Jim Vosika __ Why Share? Dedicated Win 2000 Server · PIII 800 / 256 MB RAM / 40 GB HD / 20 GB MO/XFER Instant Activation · $99/Month · Free Setup http://www.pennyhost.com/redirect.cfm?adcode=coldfusionc FAQ: http://www.thenetprofits.co.uk/coldfusion/faq Archives: http://www.mail-archive.com/cf-talk@houseoffusion.com/ Unsubscribe: http://www.houseoffusion.com/index.cfm?sidebar=lists
Re: Escaping characters
You can escape them, or you can switch the type of quotes you use to delineate the string within a CF function. Replace(x, table width=640, table width=720, all) Replace(x, 'table width=640', 'table width=720', all) Jim - Original Message - From: Jim Vosika [EMAIL PROTECTED] To: CF-Talk [EMAIL PROTECTED] Sent: Sunday, February 10, 2002 10:13 PM Subject: RE: Escaping characters I guess I dont really understand why works as well as why ## works but thanks!! use two s as in table width=640 -Original Message- From: Jim Vosika [mailto:[EMAIL PROTECTED]] Sent: Sunday, February 10, 2002 11:35 PM To: CF-Talk Subject: Escaping characters Earlier Ben Forta told me that to escape a character like in: cfset variables.test = ReplaceNoCase(variables.testVar, TD bgcolor=#ff width=1, new code , ALL) that I needed to change #FF to ##FF so it doesn't think it is a variable. Now I am trying to replace table width=640 How do I work around the quotes? Thanks, Jim Vosika __ Why Share? Dedicated Win 2000 Server · PIII 800 / 256 MB RAM / 40 GB HD / 20 GB MO/XFER Instant Activation · $99/Month · Free Setup http://www.pennyhost.com/redirect.cfm?adcode=coldfusionc FAQ: http://www.thenetprofits.co.uk/coldfusion/faq Archives: http://www.mail-archive.com/cf-talk@houseoffusion.com/ Unsubscribe: http://www.houseoffusion.com/index.cfm?sidebar=lists
RE: Escaping Characters in a SQL Statement
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 Dear all I'm running NT 4 SP5 with CF 4.5.1 SP2, Spectra 1.0.1 and PWS. If I upgrade to Windows 2000 Professional with IIS 5, are there any precautions I should be aware of? I tried searching thru this list and Allaire KB, but found nothing. Thanx. - Loke, Teng-Yan | [EMAIL PROTECTED] | +65-8313547 E-Developer | novaSPRINT.com (S) Pte Ltd -BEGIN PGP SIGNATURE- Version: PGPfreeware 6.5.8 for non-commercial use http://www.pgp.com iQA/AwUBOwHLrRQsl2B8K+e4EQI2JQCcDqQYrK7VnZbiOSP+jGQFnMty5n8An2Ey q8RekWXQPwv+GYRRg9M4nehQ =UBvw -END PGP SIGNATURE- ~~ Structure your ColdFusion code with Fusebox. Get the official book at http://www.fusionauthority.com/bkinfo.cfm Archives: http://www.mail-archive.com/cf-talk@houseoffusion.com/ Unsubscribe: http://www.houseoffusion.com/index.cfm?sidebar=lists
RE: Escaping Characters in a SQL Statement
We found that the CF Adv Security services would fail unless upsized from the default Access DBs on Win2k/IIS5.0. Apart from that, things seem to be running smoothly. But, of course, you wouldn't run Adv Security through Access DBs anyway :) Morten O. -BEGIN PGP SIGNED MESSAGE- Hash: SHA1 Dear all I'm running NT 4 SP5 with CF 4.5.1 SP2, Spectra 1.0.1 and PWS. If I upgrade to Windows 2000 Professional with IIS 5, are there any precautions I should be aware of? I tried searching thru this list and Allaire KB, but found nothing. Thanx. - Loke, Teng-Yan | [EMAIL PROTECTED] | +65-8313547 E-Developer | novaSPRINT.com (S) Pte Ltd -BEGIN PGP SIGNATURE- Version: PGPfreeware 6.5.8 for non-commercial use http://www.pgp.com iQA/AwUBOwHLrRQsl2B8K+e4EQI2JQCcDqQYrK7VnZbiOSP+jGQFnMty5n8An2Ey q8RekWXQPwv+GYRRg9M4nehQ =UBvw -END PGP SIGNATURE- ~~ Structure your ColdFusion code with Fusebox. Get the official book at http://www.fusionauthority.com/bkinfo.cfm Archives: http://www.mail-archive.com/cf-talk@houseoffusion.com/ Unsubscribe: http://www.houseoffusion.com/index.cfm?sidebar=lists
Escaping Characters in a SQL Statement
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 Dear all I have a column in a table which is of type long. After filtering for a set of records from this table, I want to write back this column into the table. This column is known to store HTML code (i.e. web pages). I only know the following characters have to be escaped: '/\. How do I write my SQL update statement such that all the possible nasty characters are escaped? Thanx. - Loke, Teng-Yan | [EMAIL PROTECTED] | +65-8313547 E-Developer | novaSPRINT.com (S) Pte Ltd -BEGIN PGP SIGNATURE- Version: PGPfreeware 6.5.8 for non-commercial use http://www.pgp.com iQA/AwUBOv800RQsl2B8K+e4EQJESwCfZ2SI8q+08PB+uyc0NupPobAqFtMAni1E ubb4VP+NoPkiASiPK31PhpjD =WN/5 -END PGP SIGNATURE- ~~ Structure your ColdFusion code with Fusebox. Get the official book at http://www.fusionauthority.com/bkinfo.cfm Archives: http://www.mail-archive.com/cf-talk@houseoffusion.com/ Unsubscribe: http://www.houseoffusion.com/index.cfm?sidebar=lists
Re: Escaping Characters in a SQL Statement
If you want to store store html in a text field in the db, you don't need to do anything if you use the cfquery tag. HTH Dick At 5:28 PM +0800 5/14/01, Teng-Yan Loke wrote: -BEGIN PGP SIGNED MESSAGE- Hash: SHA1 Dear all I have a column in a table which is of type long. After filtering for a set of records from this table, I want to write back this column into the table. This column is known to store HTML code (i.e. web pages). I only know the following characters have to be escaped: '/\. How do I write my SQL update statement such that all the possible nasty characters are escaped? Thanx. ~~ Structure your ColdFusion code with Fusebox. Get the official book at http://www.fusionauthority.com/bkinfo.cfm Archives: http://www.mail-archive.com/cf-talk@houseoffusion.com/ Unsubscribe: http://www.houseoffusion.com/index.cfm?sidebar=lists