Link to home
Start Free TrialLog in
Avatar of MPMueller
MPMuellerFlag for United States of America

asked on

How to access javascript variable with CFC?

Experts,
I would like to understand the best approach to accessing a javascript function from Coldfusion. Can someone please, in the simplest terms possible, please give an example of a way to do the following. Coldfusion 8.

<script>
   var hasThePlugin = isInstalled();
</script>

<cfset CFhasThePlugin = hasThePlugin>

Open in new window


I have no access to the "isInstalled" js function.

I feel this is a simple implementation of the cfajaxproxy tag but I'm just not getting it.

Thanks!
<script>
   var hasThePlugin = isInstalled();
</script>

<cfset CFhasThePlugin = hasThePlugin>

Open in new window

ASKER CERTIFIED SOLUTION
Avatar of Zvonko
Zvonko
Flag of North Macedonia image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of MPMueller

ASKER

Yes, and the more research I've done the more I understand, thanks for the reply.

I have successfully managed to use cfajaxproxy to update the value of a form element based on the reply to that function call, and that will work for me.

Apologies if this is off topic, but is it possible for my bind in the proxy to be fired when the page loads, as opposed to relying on a users action?

Something like:



<cfajaxproxy bind="javascript:isInstalled({vLoginName@PAGELOAD})" onsuccess="callBackHandler">

Open in new window

SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial