2

I have a ColdFusion function that checks if a record exists in a table, and if it does it returns data for the row found. However, if the record does not exist, I would like to have it make a call to a JavaScript function that I've written and use the value that is returned from the JS function to continue processing in the CF function. I know that CF is written in Java, so I'm hopeful that there is someway to perform this task.

Basically, from CF page, the steps would be...

  1. Call CF Function located in my functions.cfc file
  2. Within the CF function, make call to JavaScript function and wait for response
  3. Continue processing in CF function using the value returned from the JS function.

Any ideas? Thank you for any help!

4

2 に答える 2

2

ajax 呼び出しに JavaScript を使用しようとすると、複雑になりすぎました。cfhttp の使用に切り替えただけで、すべてが必要に応じて機能しています。CF の DeserializeJSON メソッドは、Google API から返された json オブジェクトを解析するのに最適です。

于 2013-11-07T14:41:07.013 に答える