For staters, You can only pass string/number/dates/booleans through the
URL.
When passing in a variable via javascript, as in your example, you have
to separate the variable from the string:
document.getElementById("ChartImage1").src = ("realtimechart.cfm?" +
data1);
Notice that data1 is being concatenated to the page URL of the image.
This will get Javascript to evaluate the variable the way you want. I
think you can escape the value if you want:
document.getElementById("ChartImage1").src = ("realtimechart.cfm?" +
escape( data1 ));
And this will make it URL-friendly... This would then require
UrlDecode() on the realtimechart.cfm page.
On the realtimechart.cfm page, you can get the values via the values viw
the querystring CGI.query_string or via the URL structure. However,
since you are not providing the data in a key-value pair format, your
data "Friday" will become a KEY of the URL struct with no value (I
think, but not 100% sure).
......................
Ben Nadel
Certified Advanced ColdFusion Developer
www.bennadel.com
-----Original Message-----
From: Richard White [mailto:[EMAIL PROTECTED]
Sent: Tuesday, October 17, 2006 4:44 PM
To: CF-Talk
Subject: passing data in url
hi, i am wondering how to pass data in the url and then to use it in the
page i am calling.
I have seen this in the documentation somewhere but cant find it
anywhere now :(
i think i pass data as follows in javascript:
var data1 = "Friday";
document.getElementById("ChartImage1").src = "realtimechart.cfm?data1";
the realtimechart page i am calling uses cfscript but i dont know how to
use the data1 variable that i have just sent in the url.
also does it work the same for all datatypes, i.e. whether i pass a
string, array, structure etc...
thanks for any help
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
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:257107
Subscription: http://www.houseoffusion.com/groups/CF-Talk/subscribe.cfm
Unsubscribe:
http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=11502.10531.4