escape() is a JavaScript function which replaces special characters with
the encoded equivalent. For instance, a space become "%20". The
corresponding CF function is urlencodedformat().
You will especially want to do this when you are passing user entered
data through the url which could include bad characters like & and=.
The code snippet I sent would properly escape your variable.
document.getElementById("ChartImage1").src =
realtimechart.cfm?variable_name=' + escape(data1);
Note the unescaped value is passed into the function, and the escaped
version is returned.
~Brad
-----Original Message-----
From: Richard White [mailto:[EMAIL PROTECTED]
Sent: Tuesday, October 17, 2006 4:16 PM
To: CF-Talk
Subject: Re: passing data in url
thanks for all your help :) seeing as it was mentioned a couple of times
, it is good idea to encode the variables but have never thoought about
this before, could someone possible give an example with the example
above on what is the best way to encode data1 when i send it and decode
the it in the calling page. Is the escape() part of the encoding?
thanks for your help again
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
Introducing the Fusion Authority Quarterly Update. 80 pages of hard-hitting,
up-to-date ColdFusion information by your peers, delivered to your door four
times a year.
http://www.fusionauthority.com/quarterly
Archive:
http://www.houseoffusion.com/groups/CF-Talk/message.cfm/messageid:257114
Subscription: http://www.houseoffusion.com/groups/CF-Talk/subscribe.cfm
Unsubscribe:
http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=11502.10531.4