Hello I'm a newbie using appcelerator mobile and I'm a little stuck with a problem with the url attribute from window.
I have a mainWindow folder insider resources and three files are inside that folder: main.js,master.js,detail.js
I'm trying to create a window inside of main.js file in this way:
mainWindow.masterWindow = Ti.UI.createWindow( { backgroundColor:'#961818', url:'master.js' } );
The window it's created but the script inside master.js it's not loaded. The only thing inside this file is Ti.API.log('hello!'); But nothing it's printed in the console.
If someone can help me it'd be great, also if someone can give me a link to read it'd be great to.
3 Answers
are you opening the window? if yes, we will need a larger code sample to help diagnose the issue
Hello, I checked your code.
The problem of using the URL parameter in Windows, is that the JS file will only be charged when you call the "Open" function of this window.
But when you call the "Open" of splitWindow, it doesn't make the opening of sub-windows.
But if you call "Open" directly in a window that should be in your splitWindow, it will be detached from this to be open.
In short: You can't use Windows with parameter URL in a SplitWindow.
if you really need separate files, in this case, I recommend to you use the include function:
Ti.include('YourFile.js');I update your code:
try adding the mainWindow folder to the path: url:"mainWindow/master.js"
Your Answer
Think you can help? Login to answer this question!