Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Electron - jQuery Errors

I'm working on an Electron project, and when attempting to include jQuery, I get this error:

C:\Users\Matthew\Documents\Electron\ElectronProjects\Iris\js\jquery.min.js:4 Uncaught SyntaxError:
C:\Users\Matthew\Documents\Electron\ElectronProjects\Iris\js\jquery.min.js:4 b),b&&a.jQuery===n&&(a.jQuery=Hb),n},b||(a.jQuery=a.$=n),n});jQuery v3.0.0-pre

I'v attempted to use the way that was recommended in the Electron issues page (window.$ = window.jQuery = require('./../js/jquery.min.js');). It always throws this error though.

Any ideas?

like image 851
mattrick Avatar asked Dec 20 '22 04:12

mattrick


1 Answers

<script type="text/javascript">
    window.$ = window.jQuery = require(__dirname+'/js/jquery.js');
</script>

I used this for jquery 1.9.1 version its works fine.

like image 119
Vasumithra Avatar answered Dec 28 '22 10:12

Vasumithra