gpt4 book ai didi

javascript - qooxdoo 错误(qx.html 未定义)

转载 作者:行者123 更新时间:2023-11-30 18:42:56 25 4
gpt4 key购买 nike

我正在学习 qooxdoo(顺便说一句,我认为它很棒,因为我真的理解它)。不幸的是,在遵循 Twitter 客户端教程时,我在加载页面时遇到了错误。

新建类文件MainWindow.js后

qx.Class.define("twitter.MainWindow",{    extend: qx.ui.window.Window,    construct : function()    {        this.base(arguments, "Tweeter");    }});

I go to the Application.js class file and add

var main = new twitter.MainWindow();    main.open();

which is supposed to let me see the small window.

After running generate.py sourcei get this error in firebug

qx.html is undefined[Break On This Error] return new qx.html.Element("div", styles, attributes); 

I have tried running generate.py with source-all and even build but to no avail.Can someone please help me, I really need to get started with this (I wasted two days trying to work with cappuccino and SproutCore... useless)

UPDATEI solved the issue. Apparently, i was typing the window code outside the application class definition. In my defense, the tutorial said "add this to the end of the Application.js file"

so this


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();
}
}
});

最佳答案

很好,你自己解决了这一切:-)。是的,教程文本在这一点上含糊不清,我将提交一个错误来修复它。

一般来说,qooxdoo 对其类定义使用“封闭形式”。与特定类有关的所有信息都在这张传递给 qx.Class.define 的大 map 中。该手册对类定义的各种元素进行了一定程度的解释,也许您会发现这很有帮助(参见例如 here )。

另一方面,您首先做的是完全合法的 JavaScript,因此您没有遇到任何会导致生成器立即退出的语法错误。不过,您应该已经在生成器输出中看到了警告。

关于javascript - qooxdoo 错误(qx.html 未定义),我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/6312942/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com