Tagged Questions

RequireJS is a JavaScript file and module loader. It is optimized for in-browser use, but it can be used in other JavaScript environments, like Rhino and Node. It uses the Asynchronous Module Definition (AMD) API and also supports loader plugins.

learn more… | top users | synonyms

0
votes
0answers
11 views

RequireJS: how do I handle different module dependencies for code shared between the browser and server?

I have a requireJS module loaded on both the browser and the server, to implement some shared functionality. The module however has different dependencies in each environment: In node, it needs the ...
0
votes
0answers
26 views

Require.JS in a Chrome extension: define is not defined

I'm trying to use Requre.js in my chrome extension. Here is my manifest: { "name":"my extension", "version":"1.0", "manifest_version":2, "permissions": ["http://localhost/*"], ...
2
votes
1answer
26 views

How should I write the spec file using requireJs?

I have a model which looks like this: //myModel.js define([], function () { var MyModel = Backbone.Model.extend({ // my code }); return MyModel }); Then If I want to write a ...
0
votes
1answer
21 views

Jasmine + JSTestDriver + Coverage + RequireJS

Wow, what a mess. This is the scenario. Backbone driven JS app. RequireJS for AMD functionality, initialized like this: <script data-main="js/main" src="js/require.js" ...
1
vote
1answer
8 views

Require.js from command line mode

Let's suppose I can access the following code: http://localhost/web/src/js/myApp.js Now I want to load myApp.js using requirejs from the javascript command line mode. I did try the following but ...
0
votes
1answer
22 views

backbone require js registration

How do I create a registration form in Backbone js? And send a POST to my backend, I don't understand the idea of a collection in such situation. What I got so far: define(['jQuery', 'Underscore', ...
0
votes
1answer
36 views

RequireJS loading leaf modules

I'm new to RequireJS but seem to be hitting a brick wall. The trouble starts with my "app" module. I'm not sure how to tell RequireJS to load my leaf modules - packages that depend on "app". I ...
0
votes
1answer
17 views

Loading basemodel with require.config

I have a basemodel that extends Backbone.Model and use it within all my models. I would like to include it in the require.config.paths so that within each module I can just do ...
0
votes
1answer
21 views

Require and Backbone - Loading jQuery mobile dynamically

I'm working on an app that uses Backbone and RequireJS (using the Backbone boilerplate). What I'd like to do is detect if the user is on a mobile device (currently using Modernizr to check for ...
1
vote
1answer
40 views

Require.js nested requires

I'm trying to use requireJS but I want to build a hierarchy of dependencies: main requires obr.platcom and obr.platcom requires obr (for example). I have this hierarchy of files: - index.html -> ...
0
votes
1answer
43 views

How to setup Google Analytics with Jquery, Jquery Mobile and RequireJS?

This has been bugging me for a few days now and I have not found a way to get it to work. My site is using Jquery, Jquery-Mobile and RequireJS and I want to add Google Analytics to the mix. My ...
0
votes
1answer
21 views

How to include less.js using require.js

All the .js files on the site are included using require.js. How can I include less.js using require.js as well? When I include it using tag script it doesn't work less.
0
votes
0answers
10 views

Keeping JQuery Widget Factory plugins private inside AMD modules

Is there a way to declare JQuery widget factory plugins as dependencies for AMD modules, but at the same time keep them private to that module? So that if another module wants to use the same plugin ...
1
vote
1answer
31 views

How can I cache the result of a fetch call using requireJs?

I have several views which rendering result depends on the same collection and then other models or collections: Examaples: View1 -> model1, commonCollection View2 -> collection2, ...
1
vote
1answer
33 views

Making requirejs modules AMD compliant

I'm currently building an app where the frontend is doing a lot of the heavy lifting. To keep everything neat and organised I'd like to use requirejs. However, to use require.js to its' full extent ...

1 2 3 4 5 23
15 30 50 per page