From b8f7e0abc82690d74b3fda8c3e0647d7b07fa95f Mon Sep 17 00:00:00 2001 From: Erick Calder Date: Mon, 18 Apr 2016 17:46:37 -0700 Subject: [PATCH] node.js support MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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. --- jquery.form.js | 2 ++ 1 file changed, 2 insertions(+) diff --git a/jquery.form.js b/jquery.form.js index 591ad6f1..dc00fea8 100644 --- a/jquery.form.js +++ b/jquery.form.js @@ -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 );