M
M
Moe Green2016-02-09 21:24:18
JavaScript
Moe Green, 2016-02-09 21:24:18

Gulp + Browserify + jquery.scrolly - where is the error?

I'm just learning the basics of browserify \ webpack. For practice, I created a small template on gulp + browserify.
Connected the plugin https://www.npmjs.com/package/jquery.scroolly and tried this plugin in action - https://github.com/gearmobile/draft_components/tre... .
But the example does not work and an error appears in the browser console - "TypeError: $ is not a function". Since I'm new to browserify \ webpack, I can't figure out if the reason is in my error somewhere or is it a bug in the plugin? Why doesn't he see jQuery?
Tell me, good people - what is the reason? In his example (see above), he seems to have done everything beautifully and correctly, but doubts torment him. )
UPD. Reported to the author of the plugin already. But I would like to hear the opinion of the community.

Answer the question

In order to leave comments, you need to log in

2 answer(s)
D
Dark Hole, 2016-02-09
@abyrkov

Did they add jQuery itself? XDDD
I see with the naked eye, there is no jQuery and that's it. You don't even have to look at the code. Because not $ functions, i.e. jQuery.
Add a jQuery script to the head tag and you will be happy.
True, there is a second option - in your script you have something like$.nonConflict();

E
Evgeny Simonenko, 2016-02-10
@easimonenko

Without delving too deeply into your problem (it won't work without sources), I can assume that you need to use browserify-shim, because I myself encountered a similar problem the other day.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question