Jquery on electron


hey i’m starting with electron and JS, and i decide to use jquery for make some ‘queries’ on a json file and i trying to test before develop an app, and i took an example from jquery w3school sample

i read that had to put

<script>window.$ = window.jQuery = require('./lib/jquery/jquery.min.js');</script>

for include jquery in electron but its not working, when press the button, nothing happens


I have 2 questions:

  • What do you mean by ‘press the button’?
  • What JS file is your package.json calling and does that call this HTML page?

On closer inspection of your image, I can see you’ve got a package.json/index.js/index.html, so I’ll assume that’s in order. I guess by button you mean the one in your HTML. Have you tried adding a .fail(reportSomeKindaFailure) after $getJson(...)?


It suppose than button call and show json file
{ "firstName": "John", "lastName": "Doe", "age": 25 }

This suppose to code do:


I was going to suggest seeing if there are any errors reported back, but it looks like you’re calling demo_ajax_json.js, rather than demo_ajax_json.json


OMG! that was the error, now it works how have to work. Thank you so much