“qx.Class 未定义”在源模式下加载 qooxdoo 应用程序时
在源模式下加载 qooxdoo 应用程序时,我收到以下 JavaScript 错误链:
qx.Class is undefined [中断此错误] qx.Class.define("qx.lang.Object", Object.js (ligne 24)
qx.Class 未定义 [中断此错误] qx.Class.define("qx.lang.Type", Type.js (ligne 23)
qx.lang 未定义 [中断此错误] errorToString : qx.lang.Object.select( Core.js (ligne 61)
qx.core.Property 未定义 [中断此错误] qx.core.Property.attach(clazz); Class.js (ligne 1478)
qx.lang.Type 未定义 [中断此错误] (qx.lang.Type.isObject(value) || typeof value === "object"); Assert.js (ligne 632)
qx.lang.Type 未定义 [中断此错误] qx.lang.Type.isFunction(value) ||这.__失败( Assert.js (ligne 504)
qx.lang.Type 未定义 [中断此错误] qx.lang.Type.isFunction(value) ||这.__失败( Assert.js (ligne 504)
qx.lang.Type 未定义 [中断此错误] qx.lang.Type.isFunction(value) ||这.__失败( Assert.js (ligne 504)
qx.log.Logger 未定义 [中断此错误] qx.log.Logger.register(statics); Native.js (ligne 119)
qx.lang.Type 未定义 [中断此错误] (qx.lang.Type.isObject(value) || typeof value === "object"); Assert.js (ligne 632)
qx.lang.Object 未定义 [中断此错误] statics.FROM_CHARCODE = qx.lang.Object.invert(statics.TO_CHARCODE) String.js (ligne 447)
qx.lang.Type 未定义 [中断此错误] qx.lang.Type.isString(value) ||这.__失败( Assert.js (ligne 518)
qx.lang.Core 未定义 [打破这个错误] Stack.prototype.indexOf = qx.lang.Core.arrayIndexOf; BaseArray.js (ligne 496)
qx.log.Logger 未定义 [中断此错误] qx.log.Logger.deprecatedConstantWarning( ITableModel.js (ligne 268)
qx.locale.Date 未定义 [中断此错误] MONTH_YEAR_FORMAT : qx.locale.Date...teTimeFormat("yyyyMMMM", "MMMM yyyy") DateChooser.js (ligne 111)
请注意,这些错误是在 Qooxdoo 1.0 和 1.0.1、Firefox 3.6 和 Firebug 1.5.2 中出现的。 我用 Internet Explorer 进行了测试,并得到了相同类型的 JavaScript 错误。
根据我的理解,js 文件似乎没有按正确的顺序加载/评估。
下面是js文件的加载顺序: 索引.html ria.js 远程代理.js 引擎.js 实用程序.js Bootstrap.js 设置.js 引擎.js __System.pageLoaded.dwr 变体.js 对象.js 类型.js Aspect.js Class.js
在构建模式下,一切都按预期工作。
When loading a qooxdoo application in source mode, I obtain the following chain of javascript errors:
qx.Class is undefined
[Break on this error] qx.Class.define("qx.lang.Object",
Object.js (ligne 24)
qx.Class is undefined
[Break on this error] qx.Class.define("qx.lang.Type",
Type.js (ligne 23)
qx.lang is undefined
[Break on this error] errorToString : qx.lang.Object.select(
Core.js (ligne 61)
qx.core.Property is undefined
[Break on this error] qx.core.Property.attach(clazz);
Class.js (ligne 1478)
qx.lang.Type is undefined
[Break on this error] (qx.lang.Type.isObject(value) || typeof value === "object");
Assert.js (ligne 632)
qx.lang.Type is undefined
[Break on this error] qx.lang.Type.isFunction(value) || this.__fail(
Assert.js (ligne 504)
qx.lang.Type is undefined
[Break on this error] qx.lang.Type.isFunction(value) || this.__fail(
Assert.js (ligne 504)
qx.lang.Type is undefined
[Break on this error] qx.lang.Type.isFunction(value) || this.__fail(
Assert.js (ligne 504)
qx.log.Logger is undefined
[Break on this error] qx.log.Logger.register(statics);
Native.js (ligne 119)
qx.lang.Type is undefined
[Break on this error] (qx.lang.Type.isObject(value) || typeof value === "object");
Assert.js (ligne 632)
qx.lang.Object is undefined
[Break on this error] statics.FROM_CHARCODE = qx.lang.Object.invert(statics.TO_CHARCODE)
String.js (ligne 447)
qx.lang.Type is undefined
[Break on this error] qx.lang.Type.isString(value) || this.__fail(
Assert.js (ligne 518)
qx.lang.Core is undefined
[Break on this error] Stack.prototype.indexOf = qx.lang.Core.arrayIndexOf;
BaseArray.js (ligne 496)
qx.log.Logger is undefined
[Break on this error] qx.log.Logger.deprecatedConstantWarning(
ITableModel.js (ligne 268)
qx.locale.Date is undefined
[Break on this error] MONTH_YEAR_FORMAT : qx.locale.Date...teTimeFormat("yyyyMMMM", "MMMM yyyy")
DateChooser.js (ligne 111)
Note that those errors have been obtained with Qooxdoo 1.0 and 1.0.1, Firefox 3.6 and Firebug 1.5.2.
I tested with Internet Explorer and I obtain the same kind of javascript errors.
From my understanding, it seems that the js files are not loaded / evaluated in the right order.
Below is the order in which the js files are loaded:
index.html
ria.js
RemoteProxy.js
engine.js
util.js
Bootstrap.js
Setting.js
Engine.js
__System.pageLoaded.dwr
Variant.js
Object.js
Type.js
Aspect.js
Class.js
In build mode, everything works as expected.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
在我看来,JS 文件根本没有加载。请您检查 Firebug 的“网络”选项卡是否正确加载了文件。
“源”版本和“构建”版本之间的主要区别在于 JS 文件的加载。 “源”版本确实单独加载每个 JS 文件/类以支持轻松调试。 “构建”版本确实将所有必需的类合并到一个 JS 文件中。
因此,也许您的 Web 服务器无法访问框架的路径。只是一个猜测。
It seems to me that the JS files are not loaded at all. Can you please check at the "Net" tab of Firebug if the files are loaded correctly.
The main difference between "source" and "build" version is the loading of the JS files. The "source" version does load every JS file/class separately to support easy debugging. The "build" version does combine all necessary classes to one JS file.
So maybe only the path to the framework is not accessible by your web server. Just a guess.
我终于知道问题出在哪里了。
由于我不太明白的原因,eclipse 会混淆 v1.0 和 v1.0.1 中的类。并且由于两个版本之间定义类的方式发生了变化(v1.0 使用 qx.Bootstrap.define 和 v1.0.1 使用 qx.Class.define),因此不兼容。
不管怎样,现在它正在工作,我可以玩了:)
I finaly found out where the problem come from.
For a reason I don't understand clearly, eclipse would mix up the classes from v1.0 and v1.0.1. And because the way the classes are defined changed between both versions (v1.0 use qx.Bootstrap.define and v1.0.1 use qx.Class.define), it is not compatible.
Anyway, now it is working and I will be able to play around :)