Download presentation
Presentation is loading. Please wait.
Published byAlicia Phelps Modified over 9 years ago
1
Edited by: Phạm Thuận Hiếu Ref:w3schools.com JAVASCRIPT Browser scripting
2
What is JS? -1 Scripting language Interacted Embedded Interpreted A sequence of statements Free JavaScript = ECMAScript (ECMA- 262)
3
What is JS?-2
4
We have to study JS. Why? Easy to learn. Easy to practise. Working in all major browsers We had a good knowledge of: HTML, CSS, through the previous seminar. So JS is the next step. It’s very amazing. Trust me!
5
Tools Any editors such as: Notepad, Wordpad... I use Notepad++ to illustrate all samples. When we have a large of statements: Use JSLint: assume, alert... Use Microsoft Script Debugger: control, execute, debug.......
6
Content What is JS? We have to study JS. Why? Tools Where script can be placed? JS practise
7
Where script can be placed? In, (Use one or some tags) In external files. (NOT contain the tags) Example:
8
JS Syntax-1-Variables var x; var y=0; var Y;/*comments*/ var z=“Hello”; var t=y;//comments var p = y+5; var q = p%2; var r = q/=2; var i=z+” “+”World!”; Local Global
9
JS Syntax-2-Comparisons&Operators + - * / % ++ -- = += -= *= /= %= == != > = && || ! Ternary operator ===
10
JS Syntax-3-Statements If...else Switch...cases Loop: for, while, do..while, for in Popup box: alert(“text”);//alert box confirm(“text”);//confirm box prompt(“text”,”defaultvalue”);//input value before //entering a page.
11
JS Syntax-4-Functions & Events Define a Function function functionname(var1,var2,...,varX) { //some code //return value } Events are actions that can be detected by JavaScript. RefRef
12
JS Syntax-5-Timing Events Use 2 methods: setTimeout & clearTimeout Syntax: var t=setTimeout("statement",milliseconds); clearTimeout(setTimeout_variable)
13
JS Objects ObjectMethods & attributes Stringlength, match(), replace(),...RefRef DategetDay(), getTime(),...RefRef Arrayjoin(), pop(),...RefRef BooleantoString(), valueOf()RefRef Mathround(), random(), max()...RefRef RegExpRef
14
JS Advanced & Practise JavaScript Advanced: next seminar. Now, let’s explore all basic examples.explore
Similar presentations
© 2025 SlidePlayer.com. Inc.
All rights reserved.