Skip to content

Commit

Permalink
node.js support
Browse files Browse the repository at this point in the history
for node.js environments (typically used with browserify), there is no
’jQuery’ variable predefined in the `window` since there are no
windows.  in that case we require jQuery and everything just works.
alternatively, the module needs to be shimmed.
  • Loading branch information
ekkis committed Apr 19, 2016
1 parent 6bf24a5 commit b8f7e0a
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions jquery.form.js
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,8 @@
if (typeof define === 'function' && define.amd) {
// using AMD; register as anon module
define(['jquery'], factory);
} if (typeof module !== 'undefined' {
factory(require('jquery'));
} else {
// no AMD; invoke directly
factory( (typeof(jQuery) != 'undefined') ? jQuery : window.Zepto );
Expand Down

0 comments on commit b8f7e0a

Please # to comment.