I have function that makes call to .cfc pag. I'm passing method and parameter along with the page name. Here is my code:
function callFunction(name){
param = name;
location.href = 'myTest.cfc?method=getRecords&userName=' + param;
}
Here is my cffunction on cfc page:
<cfcomponent>
<cffunction name="getRecords" access="remote" returnformat="void">
<cfargument name="userName" type="string" required="yes">
<cfset myResult = "1">
<cftry>
<cfquery name="getResults" datasource="test">
//myQuery
</cfquery>
<cfcatch>
<cfoutput>#cfcatch#</cfoutput>
<cfset myResult="0">
</cfcatch>
</cftry>
<cfreturn myResult>
</cffunction>
</cfcomponent>
My code doesn't give me return variable after I make a call to my function. I'm not sure what I'm missing in my code. If anyone can help with this problem please let me know.