|
||
JavaScriptBeginnerHow can I add 5 minutes to now? d=new Date(); alert(d); d.setHours(d.getHours() + 5); alert(d); How do I assign a JavaScript object to a CF variable? JavaScript code is executed on the client, and CF code is executed on the server, so you can't just pass a JavaScript client variable to CF. There are only three ways to get JavaScript variables to CF
Note that all three methods require two pages. The first page executes the JavaScript code, then sends the values back to the server within a second page request. So, in one page, you might have something like this <script LANGUAGE="JavaScript"> location.href = 'secondpage.cfm?colordepth=' + screen.colorDepth; </script> In the second page, you can then reference that variable: The color depth is <cfoutput>#URL.colordepth#</cfoutput>. http://www.depressedpress.com/DepressedPress/Content/ColdFusion/Essays/GIFAsPipe/ |
||
|
||