Skip to main content
Known Participant
June 3, 2009
Answered

passing variables between CFSCRIPT and Javacript

  • June 3, 2009
  • 1 reply
  • 544 views

The example below is a very crude outline what I am triying to do but is there a way to do this with cfajaxproxy or something? Can someone post or link to an example please?

<cfscript>

name ="hulfy"

</script>

<script>

var myName = #name#

</script>

    This topic has been closed for replies.
    Correct answer Dan_Bracuk

    The easiest way is to use cfoutput tags around your script tags.  That will work for simple variables.  For arrays, queries, etc, either toScript() or cfwddx would be helpful.  As far as I know, they do the same thing.

    1 reply

    Dan_BracukCorrect answer
    Inspiring
    June 3, 2009

    The easiest way is to use cfoutput tags around your script tags.  That will work for simple variables.  For arrays, queries, etc, either toScript() or cfwddx would be helpful.  As far as I know, they do the same thing.

    HulfyAuthor
    Known Participant
    June 3, 2009

    toScript is perfect

    http://livedocs.adobe.com/coldfusion/8/htmldocs/help.html?content=functions_t-z_05.html