Integrate jQuery into a electron app

后端 未结 3 1686
灰色年华
灰色年华 2021-02-09 16:49

I\'m trying to add jquery functionality to a desktop app written in electron Using the electron-quick-start repo i\'m adding the downloaded jquery file to the main.html

3条回答
  •  长情又很酷
    2021-02-09 17:29

    To integrate jQuery into your Electron Application follow these simple steps

    Step 1: Run in terminal

    npm install jquery --save
    

    Step 2: Add this line to your angular.json or angular-cli.json file

     "build": {
            "options": {
                "styles": [
                  "node_modules/bootstrap/dist/css/bootstrap.min.css",
                  "src/styles.css"
                ],
                "scripts": [
                  "node_modules/jquery/dist/jquery.js", //add this line
                  "node_modules/bootstrap/dist/js/bootstrap.min.js"
                ],
    ...
    ...
         }
      }
    

    Step 3: Finally add this line to your index.html file

     
      
      
    
      
      
    
    

    You can also use this template

提交回复
热议问题