Tutorial by Examples: amd

AMD is a module definition system that attempts to address some of the common issues with other systems like CommonJS and anonymous closures. AMD addresses these issues by: Registering the factory function by calling define(), instead of immediately executing it Passing dependencies as an array...
Create folder. Open it in command line. Run npm install webpack -g. Create 2 files: cats.js: define(function(){ return ['dave', 'henry', 'martha']; }); app.js require(['./cats'],function(cats){ console.log(cats); }) Run in command line: webpack ./app.js app.bundle.js Now i...
OpenCL is low level api so it must be implemented in "C space" first. For that, one needs to download header files from Khronos' site. My hardware is AMD and capable of version 1.2, downloading opencl.h cl_platform.h cl.h cl_ext.h cl_egl.h cl_dx9_media_sharing.h cl_d3d10.h c...
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...
In the next example, let's use Dojo features and understand what AMD ( Asynchronous Module Definition) means. <!DOCTYPE html> <html> <head> <meta charset="utf-8"> <title>Tutorial: Hello Dojo!</title> </head> <body> <h1 ...

Page 1 of 1