Is there a way to use the result of a Coldfusion query in a JavaScript function?
<CFQUERY name ="getPin" datasource = "pins">
SELECT pin
FROM pinuser
where email="#getEmail#"
</cfquery>
I am attempting to assign the pin to a JavaScript variable named pincode
. I have tried the following:
var <cfoutput>#ToScript(#pin#,"pincode")#;</cfoutput>
and then
alert(pincode)
however, this method does not seem to work. Any suggestions on how to achieve this?