3

I've downloaded jQuery 3.2.1 and jQuery UI 1.12.1 and I am loading them like so:

<script src="js/jquery-3.2.1.min.js" type="text/javascript"></script>
<script src="js/jquery-ui.js" type="text/javascript"></script>
<link rel="stylesheet" type="text/css" href="css/style.css">

I get an Uncaught reference error:

Uncaught ReferenceError: jQuery is not defined(anonymous function) @ jquery-ui.js:14(anonymous function) @ jquery-ui.js:16 index.html:165 Uncaught TypeError: table.insertRow is not a functionObject.keys.forEach.key @ index.html:165loadResultsIn @ index.html:164loadhistory @ index.html:186onload @ index.html:12

I am trying to use this with Electron. Not really sure what's going on here. Have tried loading from CDN's also and have the same problem

K20GH
  • 5,643
  • 18
  • 68
  • 110
  • might be the placement of your scripts. Isn't your error referring to an error in your index.html? maybe where you try to use jQuery? – lscmaro Aug 17 '17 at 17:12
  • either use latest `jQuery-ui` library or downgrade you main jQuery library to older-one for support of `jQuery` syntax – Anant Kumar Singh Aug 17 '17 at 17:17
  • @lscmaro I'm not using jQuery yet, only linking to it! – K20GH Aug 17 '17 at 17:28
  • @AlivetoDie 1.12.1 is the latest version of jQuery UI. I've tried jQuery 1 - 3 and all cause the same problem – K20GH Aug 17 '17 at 17:28

1 Answers1

7

Found solution here: Electron: jQuery is not defined

<!-- Insert this line above script imports  -->
<script>if (typeof module === 'object') {window.module = module; module = undefined;}</script>

<!-- normal script imports etc  -->
<script src="scripts/jquery.min.js"></script>    
<script src="scripts/vendor.js"></script>    

<!-- Insert this line after script imports -->
<script>if (window.module) module = window.module;</script>
K20GH
  • 5,643
  • 18
  • 68
  • 110