JsTestDriver - $ is not a function

半腔热情 提交于 2019-12-24 12:15:49

问题


I'm getting a strange problem, claiming that $ is not a function/is undefined. Obviously, this means that it thinks JQuery isn't defined, but if I view the source of the page and check requests, JQuery is definitely being pulled.

Total 0 tests (Passed: 0; Fails: 0; Errors: 0) (0.00 ms)
  Firefox 8.0 Linux: Run 10 tests (Passed: 0; Fails: 0; Errors 10) (0.00 ms)
    error loading file: /test/src/coffee.js:88: $ is not a function

My config file is as follows;

server: http://localhost:9876
timeout: 90
load:
    - src/datejs.js
    - src/jquery-1.6.4.js
    - src/jquery-ui-1.8.16.custom.min.js
    - src/jquery.ui.autocomplete.js
    - src/jquery.jgrowl.js
    - src/jquery.qtip.js
    - src/typewatch.js
    - src/tristate.js
    - src/jquery.weekcalendar.js
    - src/highcharts.js
    - src/coffee.js
    - # rest omitted for brevity...

Any help with this would be greatly appreciated. I've tried removing my JQuery entries in case they're overlapping with the ones in the version provided by JsTestDriver.


回答1:


I've sometimes run across issues using '$' (particularly in Drupal). Does replacing '$' with 'jQuery' have any effect?




回答2:


first of all you need to call jquery-1.6.4.js before datejs.js. then instead of $ user jQuery.

Hope it will work for you!



来源:https://stackoverflow.com/questions/8132158/jstestdriver-is-not-a-function

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!