electron遇到的问题及解决方法
程序员文章站
2021-12-25 10:58:08
...
项目采用了传统的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="../js/jquery.js"></script>
<!-- Insert this line after script imports -->
<script>if (window.module) module = window.module;</script>
或:
<script>window.$ = window.jQuery = require('../js/jquery.js');</script>
或:
$ npm install jquery
上一篇: Electron在跨平台时候的小问题
下一篇: 前端面试题4
推荐阅读