Using jsfiddle: how can I use underscore.js or backbone.js libraries?

99封情书 提交于 2019-12-08 19:16:40

问题


In jsfiddle is possible to use for example jQuery.
But I cannot see any references, for example, to underscore or backbone.js.

If I run this demo I get the error:

Uncaught ReferenceError: _ is not defined 

How can I use underscore.js or backbone.js libraries in jsfiddle?


回答1:


Add the URL for the required library under the "Add Resources" button on the left hand side.

See http://jsfiddle.net/alnitak/BwHxv/




回答2:


I'm using a self-made jsfiddle base with log included in the HTML, so you don't have to open developer tools :

Includes Backbone and Underscore

http://jsfiddle.net/drinchev/NL2z9/2/




回答3:


I usually started out from this: http://jsfiddle.net/dandiebolt/auHFG/

This comes up as the first result when searching for "jsfiddle underscore".



来源:https://stackoverflow.com/questions/10381066/using-jsfiddle-how-can-i-use-underscore-js-or-backbone-js-libraries

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