1

js,并愿意学习使用 extdirect 我遵循了节点模块中包含的文档和此页面:npmjs.org/package/extdirect,它们完全相同,当我将 firefox 指向 index.html 时,我得到了这个错误在我的 app.js 第 6 行:

ReferenceError:未定义 ExtRemote

Ext.direct.Manager.addProvider(ExtRemote.REMOTING_API);

不幸的是,在互联网上我没有找到很多示例或资源来学习如何将 extdirect 与 node.js 一起使用,所以现在我被卡住了,你能通过教程示例等为我指出正确的方法吗?谢谢

4

1 回答 1

1

After reading extdirect documentation and a somewhat related thread I recognized the definition ExtRemote.REMOTING_API comes from the server at /directapi wwhich serves something like

Ext.ns("ExtRemote");ExtRemote.REMOTING_API={"url":"http://...

hence what needs to be in index.html, maybe should be emphasized better in documentation, is a script import like

<script src="/directapi"></script>

In Sencha Architect that can be added to a project's Resources as a JS Resource.

That took care of the ReferenceError: ExtRemote is not defined.

于 2013-10-07T06:33:26.187 回答