Skip to main content

All Questions

173 votes
6 answers
70k views

Loading Backbone and Underscore using RequireJS

I'm trying to load Backbone and Underscore (as well as jQuery) with RequireJS. With the latest versions of Backbone and Underscore, it seems kind of tricky. For one, Underscore automatically registers ...
Aaronius's user avatar
  • 4,933
65 votes
4 answers
17k views

Why did Underscore.js remove support for AMD?

1.3.0 — Jan. 11, 2012 Removed AMD (RequireJS) support from Underscore. If you'd like to use Underscore with RequireJS, you can load it as a normal script, wrap or patch your copy, or download a ...
c69's user avatar
  • 20.9k
2 votes
3 answers
4k views

Trouble combining Require.js and Backbone.js/Underscore.js

I've read previous threads where other members have had identical error messages as me, but their accepted solution doesn't seem to help. Basically I get this in Chrome console when I try to load ...
MdaG's user avatar
  • 2,720
0 votes
1 answer
859 views

router.js Function not executed

// Filename: router.js console.log('TEST ROUTE'); define([ 'jquery', 'underscore', 'backbone', 'views/jobs/list' ], function($, _, Backbone, JobListView){ var AppRouter = Backbone....
CodeGuru's user avatar
  • 3,725
11 votes
3 answers
4k views

How to mixin Underscore plugins in RequireJS?

What is the right way to execute code on Underscore when it gets loaded? I am trying to execute the below code to extend the _ exported namespace automatically when modules require it: _.mixin(_.str....
TruMan1's user avatar
  • 35.3k
8 votes
3 answers
8k views

Set lodash / underscore template settings globally using require.js

Is there a way to set the templateSettings for lodash when using RequireJS? Right now in my main startup I have, require(['lodash', 'question/view'], function(_, QuestionView) { var ...
milkypostman's user avatar
  • 3,033
15 votes
5 answers
12k views

Very basic Backbone/Underscore via Require.js issue driving me batty

I am attempting to implement an EXTREMELY basic test that uses jquery, underscore.js and backbone.js loaded via require.js and for some reason I just cannot seem to get everything lined up properly. ...
greenanvil's user avatar
11 votes
2 answers
11k views

Loading templates with backbone js

I'm starting in javascript development, and did a simple project with node.js as a rest API and a client using backbone, everything look perfectly till I want to get my templates out of my js. I ...
Goofyahead's user avatar
  • 5,884
4 votes
1 answer
7k views

requirejs: Module name "underscore" has not been loaded yet for context [duplicate]

I always get this error when I freshly load my app, Error: Module name "underscore" has not been loaded yet for context: _. Use require([]) http://requirejs.org/docs/errors.html#notloaded ...,h){c=...
Run's user avatar
  • 56.5k
4 votes
4 answers
3k views

How to solve a conflict between browserify (Backbone based app) and require.js on the same page?

I have a backbone app up and running correctly. It's meant to be used as a widget in 3rd pages. Unfortunately, I just realised that one of these pages has already Backbone / underscore loaded. I get ...
Kev's user avatar
  • 5,302
2 votes
1 answer
787 views

RequireJS - How to configure Underscore before it's loaded by Backbone?

I'd like to know how to load Underscore and Backbone using RequireJS and be able to configure Underscore before it's passed to Backbone. I've seen this popular question on StackOverflow about this ...
Brad Parks's user avatar
1 vote
2 answers
2k views

Why do I need to load jquery twice [duplicate]

In my html page, I need to put jquery twice. If I take anyone of them out my page , then the page does not get rendered. Kindly note that both the included "jquery" are pointing to same location. I ...
Unbreakable's user avatar
  • 8,004