A
A
alpha9172018-02-13 20:59:15
JavaScript
alpha917, 2018-02-13 20:59:15

How to include jQuery in Electron on an external site?

First time trying Electron.
Based on https://github.com/maximegris/angular-electron I made an application that opens two windows - one with my angular application and in the other - an external site.
I add my own small script to the external site through preload, in which I connect jquery, because jquery doesn't work correctly with electron.
I connect jquery with code window.$ = window.jQuery = require("jquery");
It connects normally, everything is ok.
However, when I change something in the Angular application, both windows are reloaded and both become just white. and in the window with an external site, errors pop up

Unable to load preload script: /home/alpha917/angular-electron/dist/assets/inject.js
TypeError: Cannot read property 'createElement' of undefined

The right way

I do not understand why both windows are overloaded.
I guess why I can’t connect jquery, but I don’t know what to do with it

Answer the question

In order to leave comments, you need to log in

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question