Titanium 包括文件的问题-钛
我尝试包含同一文件夹中的js文件时出错。我试图清理我的项目,但没有用。 控制台显示“错误加载路径”。 请帮忙Titanium 包括文件的问题-钛,titanium,Titanium,我尝试包含同一文件夹中的js文件时出错。我试图清理我的项目,但没有用。 控制台显示“错误加载路径”。 请帮忙 var db={} Titanium.include('windows/gallery'); var displayButton= Ti.UI.createButton({ title:'Display', onClick:function(){ db.gallery.open(); } }); 我使用了打开函数来打开文件。打开的文件工作没有问题
var db={}
Titanium.include('windows/gallery');
var displayButton= Ti.UI.createButton({
title:'Display',
onClick:function(){
db.gallery.open();
}
});
我使用了打开函数来打开文件。打开的文件工作没有问题 通常,我们使用require('files/myFile'),其中:
Titanium.require('windows/gallery');
而不是
Titanium.include('windows/gallery');
顺便说一句,前面的方法是钛。include('windows/gallery.js);
注意include版本末尾的.js
它是移动版还是桌面版?您能显示代码吗?var db={}Titanium.include('windows/gallery');var displayButton=Ti.UI.createButton({title:'Display',onClick:function(){db.gallery.open();}}}});});我使用了打开函数来打开文件。打开的文件没有问题。很抱歉缩进不好。