jQuery working on desktop but not in Cordova


#1

I have installed jQuery my code which is working well on desktop, but fails on device in the Cordova build.

<script src="https://code.jquery.com/jquery-3.2.1.min.js"></script>

Is there something special or maybe a loading order to respect to make it work in Cordova?

For now I get this in the console:

TypeError: undefined is not a function (near ‘…jQuery(’#qrprivate’).qrcode…’)

If I test in the console for jQuery, it is present.

Thanks


#2

Meteor already comes with jQuery, so there is no need to install it yourself (and this should be avoided). Just import it like this:

import { $ } from 'meteor/jquery`;