JavaScript - Web Programming - Lecture Slides, Slides of Computer Programming

If you are looking for Web Programming course, you are at right place. This lecture key words are: Javascript, Javascript Background, Purpose of Javascript, Javascript Syntax, History Lesson, Dynamic Html, Client Side Data Entry Validation, Client Side Cgi, Process and Manage Cookies, Creating a First Script

Typology: Slides

2012/2013

Uploaded on 09/27/2013

vikrant
vikrant 🇮🇳

4.4

(9)

119 documents

1 / 56

Toggle sidebar

This page cannot be seen from the preview

Don't miss anything!

bg1
JavaScript
Part 1
docsity.com
pf3
pf4
pf5
pf8
pf9
pfa
pfd
pfe
pff
pf12
pf13
pf14
pf15
pf16
pf17
pf18
pf19
pf1a
pf1b
pf1c
pf1d
pf1e
pf1f
pf20
pf21
pf22
pf23
pf24
pf25
pf26
pf27
pf28
pf29
pf2a
pf2b
pf2c
pf2d
pf2e
pf2f
pf30
pf31
pf32
pf33
pf34
pf35
pf36
pf37
pf38

Partial preview of the text

Download JavaScript - Web Programming - Lecture Slides and more Slides Computer Programming in PDF only on Docsity!

JavaScript

Part 1

Lecture Overview

 JavaScript background  The purpose of JavaScript  JavaScript syntax

What do we do with

JavaScript?

 A starter list  Adds sizzle to pages (Animation)  Dynamic HTML (DHTML)  Client side data entry validation  Client side CGI  Reduce the load on overburdened servers  Process and manage cookies  Some servers are beginning to support JavaScript  AJAX to load parts of Web pages

What is JavaScript? (1)

 It‟s a programming language that „closely‟ resembles Java  Implementations  European Computer Manufacturers Association created ECMAScript to standardize different scripting versions See ECMA-  I‟ll try to conform  There are others  It‟s a “C ish” language

Creating a First Script

 ****

Creating a First Script

**

**


script tag

Script tag

Script language

Script Placement (2)

 Scripts appearing in a **** tag but outside a procedure execute first in the order they appear  More about procedures later  Code in a procedure is not executed unless explicitly called  Scripts appearing in a **** tag execute as they are encountered  The placement has an effect on page rendering

Handling Java Incapable Browsers

 Include the **** directive to display a message when JavaScript is disabled

**

JavaScript is not enabled.

**

JavaScript Semantics

 Semicolons need not terminate statements although they do no harm  Unless two statements are placed on the same line  Variables  var data type is generic  JavaScript is not strongly typed like Java  Type conversion happens on the fly  Other types  number , boolean , string , function , object

Creating a First Script

(Example)

 See JavaScriptExample1.htm

 Pay particular attention to the order in which the script code executes

Adding Comments

**

**

Variables (1)

 JavaScript is “loosely typed‟  data types change dynamically as the program runs  Declare variables with the var statement

Variables (3)

 Like VB, there are local and global variables  Local variables are declared inside of a procedure  Global variables are declared in a

Functions (Introduction)

 They are the same thing as a VB function or any other programming language function  Functions execute  When called by another procedure  When implemented as an event handler  Event handlers are discussed later