[thelist] JavaScript variable into CF variable

Rory.Plaire at wahchang.com Rory.Plaire at wahchang.com
Mon Nov 19 14:16:16 CST 2001


| I think the JavaScript method (window.location.href) might be 
| the answer
| but now I have to figure out how to be able to use that variable
| somewhere else on the page. For example:
| 
| <script>
|      var BaseRef = window.location.href;
| </script>
| 
| I'd like to use the variable BaseRef somewhere else in that page,
| possibly as a CF variable. Any suggestions how I can do this?

Hi Minh,

If you want to use a JS variable as a CF variable, you need another trip to
the server. You might write the variable value to a hidden form element and
pass this to the server. This could be accomplished by hidden frames, or a
refresh, or, with IE only, using WDDX and the MSXML object to pass the value
to the CF server as an XML document.

If you ask my opinion, this is all somewhat heavy for a simple 404...

What about just a document.write?

<rory disposition="it's monday... trying to smile!" alt="8]"/>




More information about the thelist mailing list