我遇到了Meteor和Jquery的問題。我添加了underscore.js和jquery,但當我嘗試運行代碼時仍然遇到跟隨錯誤。服務器在啓動之前失敗。流星與jQuery碰撞
任何幫助,將不勝感激。
這裏是輸出窗口的副本。我知道我錯過了一些非常簡單的事情。我可以讓其他流星應用程序運行。
=> Meteor server running on: localhost:3000/
.meteor\local\build\server\server.js:34
5
}).run();
^
ReferenceError: jQuery is not defined
at app/lib/jquery-ui.custom.min.js:4:4148
at \.meteor\local\build\server\serve
r.js:306:12
at Array.forEach (native)
at Function._.each._.forEach (C:\Users\rodgerse\node_modules\underscore\unde
rscore.js:79:11)
at run (\.meteor\local\build\server\
server.js:239:7)
=> Exited with code: 1
=> Meteor server restarted
\.meteor\local\build\server\server.js:34
5
}).run();
^
ReferenceError: jQuery is not defined
at app/lib/jquery-ui.custom.min.js:4:4148
at \.meteor\local\build\server\serve
r.js:306:12
at Array.forEach (native)
at Function._.each._.forEach (C:\Users\rodgerse\node_modules\underscore\unde
rscore.js:79:11)
at run (\.meteor\local\build\server\
server.js:239:7)
=> Exited with code: 1
=> Meteor server restarted
\.meteor\local\build\server\server.js:34
5
}).run();
^
ReferenceError: jQuery is not defined
at app/lib/jquery-ui.custom.min.js:4:4148
at \.meteor\local\build\server\serve
r.js:306:12
at Array.forEach (native)
at Function._.each._.forEach (C:\Users\rodgerse\node_modules\underscore\unde
rscore.js:79:11)
at run (\.meteor\local\build\server\
server.js:239:7)
=> Exited with code: 1
=> Your application is crashing. Waiting for file change.
你確定'jQuery'可用嗎?看來,jQuery UI無法訪問jQuery。 – josh
「我添加了underscore.js和jquery」 - 默認情況下,Meteor包含jQuery和Underscore,因爲Meteor的核心使用了它們兩個。你不需要做任何事情來添加它們。請注意,您只能在客戶端代碼中使用jQuery,但您可以在客戶端和服務器代碼上使用Underscore。 – sbking