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.

learn more… | top users | synonyms (1)

3
votes
0answers
14 views

Require.js - the best way to define classes and packages [closed]

I've optimized everything I could and got the following result: require.config({ paths: { 'com.company.MyClass': '....../MyClass' } }); ...
2
votes
1answer
92 views

Cross-domain with requirejs text plugin

there is my implementation for cross domain call using the requireJs text plug-in htaccess file in the template folder of my cross-domain site ...
4
votes
1answer
44 views

Correctly rewriting Japanese verb conjugator in modular JS

For my first use of javascript I've made an app that takes an input verb from html in Japanese and outputs it in to many conjugated (manipulated) forms. Essentially, it defines an alphabet, some ...
2
votes
0answers
325 views

Using RequireJS correctly for social plugins

I'm a beginner in JavaScript and lately I've been trying things with RequireJS, I'd like to get some feedback on how good/poor my code is and in what ways it can be improved. My example below is just ...
4
votes
1answer
93 views

Structure a webapp using RequireJS

I've written a small webapp in JavaScript, and am now essentially rewriting it to use RequireJS. I'm doing this partly to get more familiar with RequireJS (which I have little experience with), as ...
2
votes
1answer
225 views

Using GeoComplete with RequireJS (with shim config)

I am using the GeoComplete plugin with RequireJS It works, but please could someone confirm I've done this correctly, mainly my understanding of shim: ...
5
votes
3answers
204 views

Is there anything can be improved in this JavaScript module?

I am using RequireJS JavaScript library. I have the following JavaScript module define for dataservice: ...
7
votes
2answers
207 views

Modular design with Require.js

I am trying to get a better understanding of the modular design pattern and I am using Requirejs to manage my dependencies. I understand separating code into modules (using define with RequireJS) so ...
5
votes
1answer
1k views

Avoiding RequireJS circular dependencies

My app module bootstraps a Backbone.js application. I need app to be available in every other view for easy access to router, ...
0
votes
0answers
86 views

Requirejs modules and lazy instantiation

I’ve implemented what I think is a good structure for instantiating classes with Requirejs. My idea is that each HTML view that acts as some sort of component will have a corresponding JavaScript ...
1
vote
1answer
284 views

Layout manager: decouple DOM insertion from construction and rendering? [closed]

I'm refactoring a responsive report builder in JavaScript. Here's what it looks like: This started as a small set of objects that transformed data, rendered the graphs with D3.js, and managed the ...
2
votes
1answer
301 views

Is my Backbone.View organized properly and stylistically correct?

I'm learning BackboneJS and I just made an attempt at converting a pre-existing module to a Backbone.View. I was hoping to get some feedback on my attempt and learn. I've been using the annotated ToDo ...
4
votes
1answer
419 views

User model with BackboneJS and RequireJS with test cases in Jasmine

I've been taking a stab at implementing test cases using the Jasmine testing framework. To do so, I've made an application which has a User object. This User object is created by the server, but its ...
0
votes
2answers
157 views

Refactoring a constructor to accept a config object

So I have a function which creates a Playlist object. Currently, this function accepts two paramaters: id and name. However, it also exposes a method called 'loadData' which can set the entire object ...