Skip to main content
Known Participant
April 23, 2011
Question

js > cf

  • April 23, 2011
  • 2 replies
  • 546 views

Hello,

I need to get some data from a js file, and process it through cf/db tag.

What is the best way? I think it should be asynchronous, but I have still to get the principles of js to cf communication.

Thanks!

This topic has been closed for replies.

2 replies

talofer99
Inspiring
April 25, 2011

In order to do an http request, you an use many of the great JS options incorporated into CF like :

ColdFusion.Ajax.submitForm

http://livedocs.adobe.com/coldfusion/8/htmldocs/help.html?content=JavaScriptFcns_03.html

for example you can create a form on your page that will be set with data via JS and posted to a CF page.

Also you can use the ColdFusion.navigate

http://livedocs.adobe.com/coldfusion/8/htmldocs/help.html?content=JavaScriptFcns_24.html

in order to navigate to a certine page with info, letting that page handle the CF.

If you need more info, or examples, let me know

Inspiring
April 23, 2011

The js has to make an http request to a cf page.  This page might give you some ideas.  http://www.google.ca/#hl=en&source=hp&biw=1280&bih=885&q=javascript+httprequest&aq=0&aqi=g10&aql=&oq=javascript+htt&fp=4f06745222af36bd