“Criss Crossing Variables” was a poor way to ask someone the best way to do this, but just talking about it helped me solve my problem. I like talking to people (and by people, lately I mean Ian) about the problem that I am having because it makes me explain by problem. So, anywho… the problem is that I wanted to set some ColdFusion local variables that I could use later in the page when I was passing arguments into a JavaScript function.

I know that I could use DHTML to pass hidden values into my html and I don’t even want to get into why I needed this to be done this way… but you will see the basic use. So, let’s just say that you need to set the current page title. You can get this using the JavaScript “document” object. You can use a lot of CGI variables to get server specific information, like cgi.http_host (the domain), query_string (list of your url variables), but you cannot get or use information from the DOM.

<cfset var myPageTitle = “<script language=’javascript’ type=’text/javascript’>document.write(document.title);</script>”>

Isn’t that cool? Maybe it was obvious to some, but I found it pretty dang useful today and thought some of you may as well.