Hi... iam on MacOS X 10.6.2 with the latest Titanium version. I try to open a new WIndow in my desktop project with
var win = Titanium.UI.createWindow({url:'test.html'}); win.open();test.html is in my Resources directory but nothing happens. The window doesn't open. If it try without {url:'test.html'} then a blank window opens. I don't understand where the problem is.
4 Answers
Ok! But i found a other way. I must simple add app://
The documentation states that the url parameter be "url to a JavaScript file with the windows instructions. this window will create a new JavaScript sub-context that will run in its own thread and global variable space."
If you want to open a window with HTML, you will need to open a window that has some javascript that creates a WebView that loads the HTML.
The way I understand it, the url property refers to another .js file that has the information for instantiating the window (utilizing the Titanium API methods). You'd need to use a Webview for your example (as it is the view responsible for rendering a webpage) in conjunction with Titanium.Filesystem.getFile. In the Kitchen Sink app, see examples/web_views.js.
I'll make sure to update the documentation to make this clearer.
Your Answer
Think you can help? Login to answer this question!