Skip to main content
Inspiring
January 22, 2009
Question

Javascript to Coldfusion

  • January 22, 2009
  • 2 replies
  • 647 views
How can I pass a value from javascript into coldfusion array?

Thanks
This topic has been closed for replies.

2 replies

Inspiring
January 22, 2009
With great difficulty. js runs on the client and cf runs on the server, so, you need to make a page request that includes your javascript values as a variable that cf can read.
Inspiring
January 22, 2009
dchard wrote:
> How can I pass a value from javascript into coldfusion array?
>
> Thanks

That same ways you pass any data from the Client PC on your desk to the
server, where ever that is.

This question is a common one indicating a lack of understanding that
ColdFusion runs on the server and JavaScript runs on the client and
never shall the two meet.

You can use ColdFusion to build JavaScript before it is sent to the
client, including data. This is a very powerful thing.

JavaScript can send data from the client to a ColdFusion web page that
does any of the normal things that such a web page does with data it
receives. This is done in any of the normal manners, through Cookies,
URL (aka get) or form (aka post) variables. This happens with a normal
request to the web server.

With an asynchronous JavaScript request, this can be done behind the
scenes by the client browser, making for a more seamless user experience.

But in the end JavaScript and ColdFusion, while they can be coaxed into
passing data on, never work together.