<html>
<font size=3>1) I can't put variables in the URL and use FORM variables
at the same time?<br>
2) Why do I need to put it on the body's onload attribute? It seems to
work fine just putting it inline in the &lt;head&gt; of the
document.<br>
<br>
At 01:34 PM 8/15/00 -0400, Pete Freitag wrote:<br>
<blockquote type=cite cite>ColdFusion is run on the server side, and
JavaScript is run on the client<br>
side.&nbsp; The serverside gets run first, so you can use ColdFusion to
set<br>
JavaScript variables, but you can't use JavaScript to access
coldfusion<br>
variables. But I do see a way around your particular problem, the
code<br>
follows:<br>
<br>
<br>
&lt;cfif NOT IsDefined(&quot;url.navLanguage&quot;)&gt;<br>
<x-tab>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</x-tab>&lt;SCRIPT
LANGUAGE=&quot;JavaScript1.2&quot;&gt;<br>
<x-tab>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</x-tab><x-tab>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</x-tab>if
(navigator.appName == 'Netscape')<br>
<x-tab>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</x-tab><x-tab>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</x-tab><x-tab>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</x-tab>var
language = navigator.language;<br>
<x-tab>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</x-tab><x-tab>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</x-tab>else<br>
<x-tab>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</x-tab><x-tab>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</x-tab><x-tab>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</x-tab>var
language = navigator.browserLanguage;<br>
&lt;cfoutput&gt;<br>
<x-tab>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</x-tab><x-tab>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</x-tab>document.location
= &quot;#cgi.script_name#?#cgi.query_string#&amp;navLanguage=&quot;
+<br>
language;<br>
&lt;/cfoutput&gt;<br>
<x-tab>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</x-tab>&lt;/SCRIPT&gt;<br>
&lt;/cfif&gt;<br>
<br>
That should work as long as your not passing form variables into the
page.<br>
You need to throw that function into the body's onload attribute.<br>
<br>
_________________________________________<br>
Pete Freitag ([EMAIL PROTECTED])<br>
CFDEV.COM / NETDesign Inc.<br>
<a href="http://www.cfdev.com/" eudora="autourl">http://www.cfdev.com/</a><br>
<br>
-----Original Message-----<br>
From: Peter Theobald
[<a href="mailto:[EMAIL PROTECTED]" 
eudora="autourl">mailto:[EMAIL PROTECTED]</a>]<br>
Sent: Tuesday, August 15, 2000 1:07 PM<br>
To: [EMAIL PROTECTED]; [EMAIL PROTECTED]<br>
Subject: Javascript variables and Cold Fusion<br>
<br>
<br>
Sorry for being redundant... I know there has been plenty of discussion
on<br>
this topic lately and I didn't read any of them :-(<br>
<br>
How do I read a Javascript variable from Cold Fusion?<br>
Specifically, I need to know the browser's language setting.<br>
Here is what I would like to do:<br>
<br>
&lt;SCRIPT LANGUAGE=&quot;JavaScript1.2&quot;&gt;<br>
if (navigator.appName == 'Netscape')<br>
var language = navigator.language;<br>
else<br>
var language = navigator.browserLanguage;<br>
<br>
&lt;CFSET Session.language = (javascript) language&gt;<br>
<br>
Obviously I can't do that because CF is executed on the server before
the<br>
page is ever sent, and Javascript is run by the browser on the client
side.<br>
<br>
<br>
---------------------------------------------------------------------------<br>
Peter Theobald, Chief Technology Officer<br>
LiquidStreaming
<a href="http://www.liquidstreaming.com/" 
eudora="autourl">http://www.liquidstreaming.com</a><br>
[EMAIL PROTECTED]<br>
Phone 1.212.545.1232 Fax 1.212.679.8032<br>
<br>
----------------------------------------------------------------------------<br>
--<br>
Archives:
<a href="http://www.mail-archive.com/[email protected]/" 
eudora="autourl">http://www.mail-archive.com/[email protected]/</a><br>
To Unsubscribe visit<br>
<a href="http://www.houseoffusion.com/index.cfm?sidebar=lists&amp;body=lists/cf_talk" 
eudora="autourl">http://www.houseoffusion.com/index.cfm?sidebar=lists&amp;body=lists/cf_talk</a>
or<br>
send a message to [EMAIL PROTECTED] with 'unsubscribe' in<br>
the body.<br>
<br>
------------------------------------------------------------------------------<br>
Archives: <a href="http://www.mail-archive.com/[email protected]/" 
eudora="autourl">http://www.mail-archive.com/[email protected]/</a><br>
To Unsubscribe visit <a 
href="http://www.houseoffusion.com/index.cfm?sidebar=lists&amp;body=lists/cf_talk" 
eudora="autourl">http://www.houseoffusion.com/index.cfm?sidebar=lists&amp;body=lists/cf_talk</a>
 or send a message to [EMAIL PROTECTED] with 'unsubscribe' in the 
body. </font></blockquote><br>

<br>
-<font 
size=3>--------------------------------------------------------------------------<br>
Peter Theobald, Chief Technology Officer<br>
LiquidStreaming <a href="http://www.liquidstreaming.com/" 
eudora="autourl">http://www.liquidstreaming.com</a><br>
[EMAIL PROTECTED]<br>
Phone 1.212.545.1232 Fax 1.212.679.8032<br>
</font></html>

------------------------------------------------------------------------------
Archives: http://www.mail-archive.com/[email protected]/
To Unsubscribe visit 
http://www.houseoffusion.com/index.cfm?sidebar=lists&body=lists/cf_talk or send a 
message to [EMAIL PROTECTED] with 'unsubscribe' in the body.

Reply via email to