You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
avoid generating globals if not needed and help to easily share code between environments.
here is a sample of a wrapper that would run "everywhere":
(function(def){def('jlink',function(){//jlinq code should go herereturnjlinq;});}(// wrapper to run code everywhere// based on http://bit.ly/c7U4h5typeofrequire==='undefined'?
//Browser (regular script tag)function(name,factory){this[name]=factory();} :
((typeofexports==='undefined')?
//AMDfunction(name,factory){define(name,[],factory);} :
//CommonJSfunction(name,factory){module.exports=factory();})));
wrapping the code like this would make it work on node.js, and to be loaded properly by AMD loaders like RequireJS, Dojo (v1.6+), curl.js, etc..
The text was updated successfully, but these errors were encountered:
avoid generating globals if not needed and help to easily share code between environments.
here is a sample of a wrapper that would run "everywhere":
wrapping the code like this would make it work on node.js, and to be loaded properly by AMD loaders like RequireJS, Dojo (v1.6+), curl.js, etc..
The text was updated successfully, but these errors were encountered: