开发者

Import file error "missing name after . operator" in Titanium

when i import my file in Titanium, i have a red cross mark in front of my line showing

missing name after . operator

my code goes like this way

Ti.App.import('win1.js');
Ti.App.import('win2.js');

// Create tabgroup and tabs
var tabGroup = Titanium.UI.createTabGroup({});
var tab1 = Titanium.UI.createTab({
    ti开发者_StackOverflow社区tle: win1.title,
    window: win1
});
var tab2 = Titanium.UI.createTab({
    title: win2.title,
    window: win2
});
tabGroup.addTab(tab1);
tabGroup.addTab(tab2);
tabGroup.open({});

in first and second line i have such type of error though i have created those two files....


Use

Ti.include('relative-path-for-file-to-include.js');

or

Titanium.include('relative-path-for-file-to-include.js');

instead.


i found this way of including other files in titanium.... and it worked for me.

Titanium.include("page1.js");


It should be:

#include "win1.js";

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜