我有一个很大的HTML5应用程序,我正在使用Titanium来为它添加本机支持。最简单的hello world对我来说是:如何从WebView中引用Titanium JavaScript?
var webview = Titanium.UI.createWebView({url:'http://myApp.com'});
var window = Titanium.UI.createWindow();
window.add(webview);
window.open();
但是,如果我尝试使用钛API从现有代码中它没有引用。有没有一个配置文件选项可以使我的网络应用程序可以使用Titanium API?
我刚刚发现这个在docs:
Scripts downloaded from remote web servers cannot access the Titanium namespace,
however, you can use the web view evalJS method to execute a JavaScript
expression inside the web view, and retrieve the value of an expression.
除了轮询的WebView的背景下,有什么办法有上下文的访问钛API?
我发现在API中,却从来没有机会实现它。与PhoneGap一起去。 – user1873073