bengourley / modal.js

An async modal window for the browser
12 stars 13 forks source link

Uncaught ReferenceError: $ is not defined #18

Open KenKennef opened 8 years ago

KenKennef commented 8 years ago

Can anyone help me with this error? I get it when I require modal and use example code. The error is from modal.js line 62

bengourley commented 8 years ago

Hi. Unfortunately modal depends on jQuery being globally available on the page. If you're not loading jQuery at all, load it with a <script> tag on your page. If you're loading it via browserify, do window.jQuery = window.$ = require('jquery') or something similar. Hope this helps.

ooxi commented 8 years ago

How about providing modal-npm.js, which would require all necessary dependencies and would not require dependencies in the global namespace?