Presentation is loading. Please wait.

Presentation is loading. Please wait.

Intro to JavaScript Scripting language –ECMAScript compliant –Client side vs. server side Syntactic rules –White space –Statement end: ; optional –Comments:

Similar presentations


Presentation on theme: "Intro to JavaScript Scripting language –ECMAScript compliant –Client side vs. server side Syntactic rules –White space –Statement end: ; optional –Comments:"— Presentation transcript:

1 Intro to JavaScript Scripting language –ECMAScript compliant –Client side vs. server side Syntactic rules –White space –Statement end: ; optional –Comments: // or /* */ –Case sensitive –Variables Types: number, string, boolean, null, undefined Scope: global vs. local Naming: start with letter or '_'

2 JavaScript Expressions & Operators Operators –Arithmetic: + - * / % ++ -- –Comparison: == != = –Logical: && || ! –Bitwise: & | ^ ~ > –Assignment: = += -= *= /= %= –Special: conditional, comma, new, this, typeof Operator precedence –Member > call > negation/increment > multiply/divide > add/subtract > bitwise shift > relational > equality > bitwise and/xor/or > logical and/or > conditional > assignment > comma

3 JavaScript Objects Pre-defined objects –Array, Math, String, Boolean, Number, Date, RegExp Defining objects function classname(p1, p2) { this.p1 = p1; this.p2 = p2; this.m1 = m1; }

4 JavaScript Statements Assignment Declarations: var, function Conditional: if..else, switch..case..default Looping: for, for..in, while, do Program flow: break, continue, return Other: with

5 JavaScript Functions Pre-defined functions –Conversion & comparison: eval, isNaN, typeof, valueOf, toString –Dialog boxes: alert, confirm, prompt Defining functions function fname (param_list) { statements } Calling functions fname(param_list)

6 HTML DOM The HTML Document Object Model has… Its own properties and methods Element properties and methods Attribute properties and methods

7 JavaScript Events Using events to call functions Click on this text! Events –Mouse: onclick, ondblclick, onmousedown, onmousemove, onmouseout, onmouseover, onmouseup –Keyboard: onkeydown, onkeypress, onkeyup –Other user actions: onblur, onchange, onfocus, onreset, onresize, onselect, onsubmit, onunload –System actions: onabort, onerror, onload


Download ppt "Intro to JavaScript Scripting language –ECMAScript compliant –Client side vs. server side Syntactic rules –White space –Statement end: ; optional –Comments:"

Similar presentations


Ads by Google