jmenglish
09-08-2007, 02:15 PM
I am using the HTML tag to embed HTML and calling java script functions from Laszlo using callJS. This works fine for functions with out return values, but I am having problems using the callback function with callJS.
Here is my Laszlo code:
<button>Map Call
<handler name="onclick">
LzBrowser.callJS("map.test_call_back();",mapCallResult());
function mapCallResult(res){
Debug.write("JS Call Back"+res);
}
</handler>
</button>
and my embedded HTML code:
function test_call_back(){
alert("In Test Call Back Function");
return ("Returned Value");
}
When I try to use the callback function with a return value I get a "$9.apply is not a function" error in my browser error console, and I can only call the function once. With out the return statement in the JS function I can call the function multiple times as would be expected.
Can someone help me understand how to use the callback function with LzBrowser.callJS()?
Here is my Laszlo code:
<button>Map Call
<handler name="onclick">
LzBrowser.callJS("map.test_call_back();",mapCallResult());
function mapCallResult(res){
Debug.write("JS Call Back"+res);
}
</handler>
</button>
and my embedded HTML code:
function test_call_back(){
alert("In Test Call Back Function");
return ("Returned Value");
}
When I try to use the callback function with a return value I get a "$9.apply is not a function" error in my browser error console, and I can only call the function once. With out the return statement in the JS function I can call the function multiple times as would be expected.
Can someone help me understand how to use the callback function with LzBrowser.callJS()?