6

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

4
  • 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? Commented Aug 17, 2017 at 17:12
  • either use latest jQuery-ui library or downgrade you main jQuery library to older-one for support of jQuery syntax Commented Aug 17, 2017 at 17:17
  • @lscmaro I'm not using jQuery yet, only linking to it! Commented Aug 17, 2017 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 Commented Aug 17, 2017 at 17:28

1 Answer 1

8

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>
Sign up to request clarification or add additional context in comments.

Comments

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.