Presentation is loading. Please wait.

Presentation is loading. Please wait.

MSc. Publishing on WWW JavaScript. What is JavaScript? A scripting language devised by Netscape Adds functionality to web pages by: Embedding code into.

Similar presentations


Presentation on theme: "MSc. Publishing on WWW JavaScript. What is JavaScript? A scripting language devised by Netscape Adds functionality to web pages by: Embedding code into."— Presentation transcript:

1 MSc. Publishing on WWW JavaScript

2 What is JavaScript? A scripting language devised by Netscape Adds functionality to web pages by: Embedding code into HTML (client side) Providing processing features (server side) Object oriented NOT Java

3 Features of JavaScript Usually embedded in the HTML Generally browser independent Event driven Interpreted scripting language

4 Uses of JavaScript Frame control Data validation Rollovers, drop down menus Graphics effects – animation etc.

5 JavaScript Terminology Interact with computer or applications by pressing keys Trigger events which cause things to happen Events are associated with code JavaScript is: Event driven Uses event handlers

6 Where to Put JavaScript Within tags Attached directly to event handlers Create functions (small programs)

7 Within Tags Simplest method. Place in of a web doc using the tag. alert(“Hello world”)

8 Attached to Handler Can be attached to an event handler of an HTML object e.g. a FORM button Will run when the event occurs. Example

9 Functions Functions can be written and placed in the of a document. Runs either: When called within tags When attached to an HTML object in

10 Example function hello() {alert("Hello World")} A Sample JavaScript A Simple JavaScript Example hello()


Download ppt "MSc. Publishing on WWW JavaScript. What is JavaScript? A scripting language devised by Netscape Adds functionality to web pages by: Embedding code into."

Similar presentations


Ads by Google