JavaScript: Getting Started

Overview of JavaScript
Used primarily for Web pages (i.e., runs in browser)
To make them more interactive
To get updates from the server without reloading the page (Ajax)
Use growing in contexts other than Web browsers
Node.js for running JavaScript on server
Mozilla Rhino for running JavaScript on desktop
Simpler than most other programming languages (arguably)
So a good starting point for beginning programmers
Second-most popular language behind Java (arguably)
So many jobs available
Not closely related to Java
Despite the similar-sounding names

Interactive JavaScript Practice
Firebug or Google Chrome Tools
Use Firebug command line for interactive testing

Variables
Introduce with “var”
-For global variables (!) and local variables.
-No “var” for function arguments
You do not declare types
-Some people say JavaScript is “untyped” language, but technically it is “dynamically typed” language
- JavaScript is very liberal about converting types
There are only two scopes
-Global scope
-Be very careful with this when using Ajax
-Can cause race conditions
-Function (lexical) scope
-There is not block scope as in Java
Operators
和JAVA一样

Functions: Basics

JavaScript: Functions

Functional programming, not object-oriented programming
OOP in JavaScript is radically different than in most languages

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值