2013-02-05 26 views
5

Có ai có kinh nghiệm tích hợp dojo 1.8 với requrejs không? Nếu tôi sử dụng requrejs để tải dojo/dijit/dojox, nó sẽ ném một số ngoại lệ về has.js không hoạt động chính xác.Sử dụng dojo 1.8 với requirejs

TypeError: _3.add is not a function
_3.add("dom-addeventlistener",!!document.addEventListener);

+0

http://requirejs.org/docs/dojo.html –

Trả lời

3

từ

http://requirejs.org/docs/dojo.html

As of Dojo 1.8, Dojo has converted their modules to AMD modules. However, Dojo uses some loader plugins, and the loader plugin APIs are still in draft mode for AMD. So while some modules from Dojo can be used with RequireJS, it will be difficult to use all of Dojo. It is best to use Dojo's AMD loader until ticket 15616 has been resolved.

http://bugs.dojotoolkit.org/ticket/15616

+0

nên nó có nghĩa là nó không thể sử dụng requirejs với dojo1. 8 bây giờ? Chúng tôi phải đợi bản phát hành dojo1.9? – fengtianxp

+0

Có vé hiện đang được lên lịch cho 1,9. Bạn đang cố gắng sử dụng RequireJS cho cái gì? Điều gì xảy ra khi Dojo thực hiện bộ nạp AMD không hoạt động cho bạn? –

+0

Tôi muốn sử dụng gcli https://github.com/mozilla/gcli, trong ứng dụng dựa trên dojo. Nếu tôi sử dụng dojo để tải gcli, nó sẽ thất bại vì trình tải khác. Vì vậy, có lẽ tôi chỉ có thể sử dụng requirejs để tải dojo. Có lẽ nó vẫn không hoạt động. – fengtianxp