How to use jQuery with browserify? -


I have installed jQuery (v1.11.1) with npm. (I need 1x because I want to use it with glass which does not support 2.x).

Then I try to import the jQuery object with the required object through the browser I am doing it, but it seems that the return thing is not expected, so I can not use it.

var jQuery = require ('jquery / dist / jquery') (window);

While trying to use it, I get the Unkot Type error: object function is not .

What am I doing wrong? How can I use the browser with jQuery?

In the main code> jquery.js , So you can do this:

  var jQuery = require ('jquery'); JQuery ('body'). Text ('Hello World');   

Note that jQuery has its own factory export only if there is no global document property when used with browserfair, then the one which is exported It does not have a factory function, but regular jQuery objects.

Comments

Popular posts from this blog

ios - Adding an SKSpriteNode to SKScene from a child SKSpriteNode -

Matlab transpose a table vector -

c# - Textbox not clickable but editable -