Calling Ti API from WebView JavaScript Only Works When HTML is Local?
Hello,
In the local_webview.js
file in KitchenSink, there's an example where clicking a div
on the web page calls some native Titanium methods, such as Ti.API.info
(see lines 46-50).
I tried doing something similar, but in my example, the web page that's displayed in the WebView is coming from a remote server, not a local HTML like the KitchenSink example. In this case, I can't get the calls to native Ti functions like Ti.API.info
to work. I tried it on both Android and iPhone.
Is this expected? Do calls to native Ti functions from a web page's JavaScript only work when the HTML is coming from a local file?
Thanks!!!
-Ryan
1 Answer
-
Yes, only from a local source.