I'm writing a Firefox addon and need to import jQuery.
Tried import {$,jQuery} from 'jquery';
from here but didn't work and I should use like import(browser.runtime.getURL('/js/jquery.js')).then(jq => {});
, but getting error jq is not a function on code jq('#app')
also getting same problem for $('#app')
.
Asked
Active
Viewed 382 times
0

Kazem Ma
- 31
- 7
-
Why dont you try use the cdn for `jquery` ? – Kopi Bryant Jun 12 '21 at 17:32
-
https://stackoverflow.com/questions/5415821/jquery-from-cdn – Kopi Bryant Jun 12 '21 at 17:32
-
Does this answer your question? [Latest jQuery version on Google's CDN](https://stackoverflow.com/questions/12608242/latest-jquery-version-on-googles-cdn) – Kopi Bryant Jun 12 '21 at 17:33
-
because can't load modules from CDN in addons – Kazem Ma Jun 12 '21 at 19:40