JavaScript简介
来源:互联网 发布:excel建立数据库 编辑:程序博客网 时间:2024/05/22 09:06
用JavaScript写个桌面级应用
- 打开cmd运行npm init创建 package.json文件(和node的基本一样)
- 然后执行一次npm install –save-dev electron-prebuilt
- 在根目录下创建main.js
- 然后在app下创建index.html文件
配置VS Code启动环境
先装全局:glup: npm install gulp -g//全局安装gulp(前端自动化工具,只是为了方便)
再装本地:npm install –save-dev gulp
- 安装 electron-packager:npm install –save-dev electron-packager
在项目根目录下面的 package.json 里添加代码:
“packager”: “electron-packager ./app HelloWorld –all –out ./xxApp –version 1.4.6 –overwrite –icon=./app/img/icon/icon.ico”
- 使用命令npm run-script packager(打包)
Introduction to JavaScript
- There are three essential data types in JavaScript: **strings, numbers, and boolean**s.
- We can write out anything to the console with console.log.
- We can do math with operators like +, -, *, and /.
- We can find the remainder after dividing two numbers with a modulus: %.
- We can generate a random number with Math.random, then make it a whole number with Math.floor.
- We write a single line comment with // and a multi-line comment with /* and */
Variables
- How to create variables:var.
- How to change a variable’s value.
- How to interpolate, or insert, a variable into a string.
Control flow
- if/else statements make binary decisions and execute separate code based on a condition.
- We can add extra conditions with to if/else statements with else if conditions.
- switch statements make complicated if/else statements easier to read, however they achieve the same result as if/else statements.
- Comparison operators, like <, >, <=, and >= can compare two variables. After they compare, they always return either true or false.
- Logical Operators, like &&, ||, !==, and !, can compare two variables to see if a certain condition exists:
- && checks if both sides are true.
- || checks if either side is true.
- !== checks if both sides are not equal.
- ! changes a variable that is true to false, and vice versa.
参考文献:
1.用JavaScript写个桌面级应用
0 0
- JavaScript--简介
- JavaScript 简介
- JavaScript 简介
- JavaScript简介
- javaScript 简介
- JavaScript简介
- JavaScript简介
- Javascript 简介
- JavaScript 简介
- JavaScript简介
- javaScript简介
- JavaScript 简介
- javascript简介
- Javascript简介
- JavaScript简介
- JavaScript简介
- JavaScript 简介
- Javascript简介
- JS字符串替换-原始replace单个替换和自定义replaceAll全部替换
- 浅谈下linux的内存机制
- 八、10行代码建起你的网站
- Salesforce 的Cache玩法
- linux上GIT的使用
- JavaScript简介
- Pandas读取MongoDB数据库到DataFrame
- Sass的嵌套
- 使用Visio 2013 画跨职能流程图
- 使用ActionBar
- 上周热点回顾(1.16-1.22)
- 洛谷 1443——马的遍历(广度优先搜索)
- 是谁制造问题,谁就要承担责任,谁就要受到追究
- 关于免费解决RedHat6.4的:This system is not registered to Red Hat Subscription Management.