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
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
15 votes
2 answers
12k views

Localizing templates using require.js, backbone and underscore

This question is about templating and localizing, using require.js and underscore templates through backbone.js. The application will need to be localised on the fly. Before embarking down a path ...
Robbie's user avatar
  • 17.7k
15 votes
5 answers
10k views

RequireJS and text plugin Load timeout for modules

I am having some problems getting the RequireJS text plugin to work. This is possibly a path related issue (or something similarly obvious) but I can't solve it because neither the chrome console (...
Johannes Degn's user avatar
14 votes
1 answer
11k views

Phonegap and the universe of frameworks?

my concern is to find a well fitting framework for developing a cross mobile platform app via phonegap. I am using JQMobile for the User interface. I want to build my Application well structured and ...
chriz's user avatar
  • 143
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
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
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
8 votes
2 answers
814 views

Using Lo-Dash and Underscore simulatenously in RequireJS environment

In a RequireJS environment, what's the best way to allow some AMD modules to use Lo-Dash while others simultaneously use Underscore?
Donald T's user avatar
  • 10.5k
7 votes
1 answer
1k views

Requirejs, issue in loading the library underscore

I am using the require.version "2.0.0" And I would like to get the underscore as a local variable: Here's my code (1). Why _ is undefined? How can I get _ inside the function like a local variable (...
Lorraine Bernard's user avatar
6 votes
5 answers
1k views

What is the best way to include jQuery, Underscore, and Backbone as AMD modules using require.js?

I've seen many variations to loading modules which do not support AMD yet, and I would like to know what is the best practice to do so. Eventually, I would like to write modules like this: module.js:...
Ron Reiter's user avatar
  • 3,896
6 votes
2 answers
494 views

Why include jQuery and underscore in every JS file in Backbone/Require.js project

In almost every Backbone/Require.js project you will see models and views that look similar to this: define([ 'jquery', 'underscore', 'backbone' ], function ($, _, Backbone) { //Some ...
Lochlan's user avatar
  • 2,726
5 votes
4 answers
3k views

Underscore.string with RequireJS

I'm trying to use both Underscore and Underscore.string with RequireJS. Contents of main.js: require.config({ paths: { 'underscore': '//cdnjs.cloudflare.com/ajax/libs/underscore.js/1.4.4/...
Mirzhan Irkegulov's user avatar
5 votes
1 answer
17k views

Load timeout for modules with requirejs

I'm using requirejs to load some libraries and dependencies. When I just load jQuery, it's working perfectly: main.js require.config({ shim: { jquery: { exports: '$' } }, paths: ...
Luke's user avatar
  • 3,046

15 30 50 per page
1
2 3 4 5
10