[Xsltforms-support] Asynchronous javascript.
Brought to you by:
alain-couthures
From: Mark L. <tin...@gm...> - 2013-10-04 20:15:09
|
Hi, I'm looking into whether I can inject results from the relocation API into an <xf:instance/> I've added in a extension JS function to do the call like so: <script > XPathCoreFunctions['http://example.net/xforms/new-functions/ new-func'] = new XPathFunction( false, XPathFunction.DEFAULT_NONE, false, function() {{ return navigator.geolocation.getCurrentPosition(show_map); }} ); function show_map(position) {{ var latitude = position.coords.latitude; var longitude = position.coords.longitude; alert(position.coords.latitude+","+ position.coords.longitude); return "hello"; }}; </script> However, I don't get a return as the js calls a callback rather than waiting. Any ideas? Rgds, Mark Lawson. |