Tutorial by Examples

The following example will demonstrate a basic installation and setup of RequireJS. Create a new HTML file called index.html and paste the following content: <!DOCTYPE html> <html lang="en"> <head> <title>Hello RequireJS</title> <script type=&...
The following example expands upon Hello World by demonstrating multiple dependencies using the define() function. Create a new HTML file called index.html and paste the following content: <!DOCTYPE html> <html lang="en"> <head> <title>Hello RequireJS</t...
A single entry point to your application is possible with RequireJS by using the data-main attributed within the <script> tag. <script type="text/javascript" data-main="scripts/main" src="http://requirejs.org/docs/release/2.3.2/minified/require.js"></scr...
Not all libraries are defined in a way that is compatible with AMD and RequireJS's define() function. The author's have addressed this by including a shim directive for configuring those dependencies. One example is using the jQuery UI Layout Plugin. That plugin depends on jQuery. You can configu...

Page 1 of 1