我正在学习 qooxdoo(我认为这很棒,因为我真的理解它)。不幸的是,在遵循 twitter 客户端教程时,我在加载页面时遇到了错误。
创建新的类文件后 MainWindow.js
qx.Class.define("twitter.MainWindow", { 扩展:qx.ui.window.Window, 构造:函数() { this.base(arguments, "Tweeter"); } });
我去 Application.js 类文件并添加
var main = new twitter.MainWindow(); main.open();
这应该让我看到小窗户。
运行后generate.py source
我在萤火虫中得到这个错误
qx.html 未定义 [Break On This Error] return new qx.html.Element("div", styles, attributes);
我尝试过运行generate.py,source-all
甚至build
没有成功。有人可以帮我吗,我真的需要开始做这个(我浪费了两天时间尝试使用卡布奇诺和 SproutCore ......没用)
更新 我解决了这个问题。显然,我在应用程序类定义之外输入了窗口代码。在我的辩护中,教程说“将其添加到 Application.js 文件的末尾”
所以这
qx.Class.define("twitter.Application",
{
extend : qx.application.Standalone,
members :
{
main : function()
{
// Call super class
this.base(arguments);
// Enable logging in debug variant
if (qx.core.Environment.get("qx.debug"))
{
qx.log.appender.Native;
qx.log.appender.Console;
}
}
}
});
var main = new twitter.MainWindow();
main.open();
应该是
qx.Class.define("twitter.Application",
{
extend : qx.application.Standalone,
members :
{
main : function()
{
// Call super class
this.base(arguments);
// Enable logging in debug variant
if (qx.core.Environment.get("qx.debug"))
{
qx.log.appender.Native;
qx.log.appender.Console;
}
var main = new twitter.MainWindow();
main.open();
}
}
});