开发者

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

开发者 https://www.devze.com 2023-03-27 15:31 出处:网络
when i import my file in Titanium, i have a red cross mark in front of my line showing missing name after . operator

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

精彩评论

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

关注公众号