Я только начал изучать Electron и хочу использовать Jquery в своем приложении.
Electron
Jquery
Это простая демонстрационная программа оповещения.
<!DOCTYPE HTML> <HTML> <head> <meta charset="UTF-8"> <title>Hello World!</title> <link rel="stylesheet" href="https://stackpath.bootstrapcdn.com/bootstrap/4.1.3/css/bootstrap.min.css" integrity="sha384-MCw98/SFnGE8fJT3GXwEOngsV7Zt27NXFoaoApmYm81iuXoPkFOJwJ8ERdknLPMO" crossorigin="anonymous"> <!--Fontawesome CDN--> <link rel="stylesheet" href="https://use.fontawesome.com/releases/v5.3.1/css/all.css" integrity="sha384-mzrmE5qonljUremFsqc01SB46JvROS7bZs3IO2EmfFsd15uHvIt+Y8vEf7N7fWAU" crossorigin="anonymous"> <!--Custom styles--> <link rel="stylesheet" href="../assets/css/main.css"> <!-- https://electronjs.org/docs/tutorial/security#csp-meta-tag --> <script src="../assets/js/jquery.min.js"></script> <script src="../assets/js/parsley.min.js"></script> <script> $(document).ready(function () { $("#btn-submit").click(function () { console.log("Button was clicked."); }); }); </script> </head> <body> <form id="demo-form" data-parsley-validate=""> <div class="container"> <div class="d-flex justify-content-center h-100"> <div class="card"> <div class="card-body"> <form> <div class="form-group"> <input type="button" id="btn-submit" value="Login" class="btn float-right login_btn"> </div> </form> </div> </div> </div> </div> </form> <script src="index.js"></script> </body> </html>
Я просто добавлю эту строку кода выше <script> code.
<script> code.
<script> window.$ = window.jQuery = require('../assets/js/jquery.min.js'); </script>