mirror of
https://github.com/ElectronNET/Electron.NET.git
synced 2026-02-03 21:25:13 +00:00
Electron Jquery error #397
Reference in New Issue
Block a user
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Originally created by @vardear1 on GitHub (Oct 25, 2019).
Developed an application with core 2.2 MVC and followed all the steps to use electron. After starting the application, the electron window opens with the splash page, however, I am receiving an error for jquery - Uncaught TypeError: Cannot read property 'fn' of undefined. Googled a lot for a solution without success. Any assistance to resolve this would be greatly appreciated. Thanks

@Liam2349 commented on GitHub (Oct 26, 2019):
Are you trying to load jQuery yourself?
Electron already uses jQuery, so you have to load it a bit differently to use in your own scripts. I'm doing it like this:
<script src="~/js/jquery-3.4.1.min.js" onload="window.$ = window.jQuery = module.exports;" asp-append-version="true"></script>You could copy this and replace the path to match your own project structure.
The asp-attribute is optional. You shouldn't need it for this file but I use it anyway.
@vardear1 commented on GitHub (Oct 28, 2019):
Thanks so much Liam. Your solution worked like a charm