hi
ive embedded gecko in my c++ app. in the app window, ive loaded an
html page that also defines a JS method. i would like to invoke this
method and get the return value.
ive seen a lot of blog/group posts related to XPCOM/JS and read about
spidermonkey(JS_CallFunctionName?). can someone point me in the right
direction as to how to actually go about doing this? i am unable to
find sample code on this :(
cheers
amitabh
--------- test.html ---------
<html>
<script language="JavaScript" type="text/JavaScript">
function fn_test()
{
return "teststring" ;
}
</script>
<body>hello!</body>
</html>
--------- c++ -------------
//i would like to call something like this
mybrowser.loadURI("test.html")
mybrowser.calljavascript("fn_test", &rv); //rv shd have "teststring"
_______________________________________________
dev-embedding mailing list
[email protected]
https://lists.mozilla.org/listinfo/dev-embedding