JavaScript Introduction. Slide 2 Lecture Overview JavaScript background The purpose of JavaScript A first JavaScript example Introduction to getElementById.

Slides:



Advertisements
Similar presentations
JavaScript and AJAX Jonathan Foss University of Warwick
Advertisements

JavaScript FaaDoOEngineers.com FaaDoOEngineers.com.
Introduction to JavaScript
1 CSC 551: Web Programming Spring 2004 client-side programming with JavaScript  scripts vs. programs  JavaScript vs. JScript vs. VBScript  common tasks.
Lesson 12- Unit L Programming Web Pages with JavaScript.
The Web Warrior Guide to Web Design Technologies
Web Development in Microsoft Visual Studio Slide 2 Lecture Overview Introduce Visual Studio 2013 Create a first ASP.NET application.
MSc. Publishing on WWW JavaScript. What is JavaScript? A scripting language devised by Netscape Adds functionality to web pages by: Embedding code into.
1 Owais Mohammad Haq Department of Computer Science Eastern Michigan University April, 2005 Java Script.
Lecture 3B: Client-Side Scripting IT 202—Internet Applications Based on notes developed by Morgan Benton.
HTML Recall that HTML is static in that it describes how a page is to be displayed, but it doesn’t provide for interaction or animation. A page created.
Web Page Behavior IS 373—Web Standards Todd Will.
JavaScript Part 1. Slide 2 Lecture Overview JavaScript background The purpose of JavaScript JavaScript syntax.
CS 299 – Web Programming and Design Overview of JavaScript and DOM Instructor: Dr. Fang (Daisy) Tang.
(CS1301) Introduction to Computer Programming City Univ of HK / Dept of CS / Helena Wong 1. Overview of Programming and JavaScript - 1
Inline, Internal, and External FIle
Introduction to JavaScript. Aim To enable you to write you first JavaScript.
DHTML - Introduction Introduction to DHTML, the DOM, JS review.
Javascript and the Web Whys and Hows of Javascript.
DHTML. What is DHTML?  DHTML is the combination of several built-in browser features in fourth generation browsers that enable a web page to be more.
4.1 JavaScript Introduction
Lecture Note 3: ASP Syntax.  ASP Syntax  ASP Syntax ASP Code is Browser-Independent. You cannot view the ASP source code by selecting "View source"
CS346 - Javascript 1, 21 Module 1 Introduction to JavaScript CS346.
HTML Forms and Scripts. Session overview What are forms? Static vs dynamic Client-side scripts –JavaScript.
JavaScript, Fifth Edition Chapter 1 Introduction to JavaScript.
Advanced Web Design Scripting Tutorial Chapters. Scripting Intro The scripting part of the forthcoming Advanced Web Design textbook introduces you to.
SEG3210 DHTML Tutorial. DHTML DHTML is a combination of technologies used to create dynamic and interactive Web sites. –HTML - For creating text and image.
Javascript Languages By Rapee kamoltalapisek ID:
JavaScript Tabriz university Its September 1995.
JavaScript is a client-side scripting language. Programs run in the web browser on the client's computer. (PHP, in contrast, is a server-side scripting.
SEG3210 DHTML Tutorial. DHTML DHTML is a combination of technologies used to create dynamic and interactive Web sites. –HTML - For creating text and image.
Working with Objects Creating a Dynamic Web Page.
Client Scripting1 Internet Systems Design. Client Scripting2 n “A scripting language is a programming language that is used to manipulate, customize,
Lesson13. JavaScript JavaScript is an interpreted language, designed to function within a web browser. It can also be used on the server.
An Introduction to JavaScript Summarized from Chapter 6 of “Web Programming: Building Internet Applications”, 3 rd Edition.
Introduction to Programming the WWW I CMSC Summer 2003 Lecture 7.
Web Development in Microsoft Visual Studio Slide 2 Lecture Overview How to create a first ASP.NET application.
Client-side processing in JavaScript.... JavaScript history Motivations –lack of “dynamic content” on web pages animations etc user-customised displays.
JavaScript Tutorial 1 - Introduction to JavaScript1 Tutorial 1 Introduction to JavaScript Section A – Programming, HTML, and JavaScript.
Client-side & Server-side Scripting ©Richard L. Goldman August 5, 2003 Requires PowerPoint 2002 or later for full functionality.
By Tharith Sriv. To write a web page you use: HHTML (HyperText Markup Language), AASP (Active Server Page), PPHP (HyperText Preprocessor), JJavaScript,
JavaScript Introduction.  JavaScript is a scripting language  A scripting language is a lightweight programming language  A JavaScript can be inserted.
CIS 375—Web App Dev II JavaScript I. 2 Introduction to DTD JavaScript is a scripting language developed by ________. A scripting language is a lightweight.
JavaScript Overview Developer Essentials How to Code Language Constructs The DOM concept- API, (use W3C model) Objects –properties Methods Events Applications;
 Web pages originally static  Page is delivered exactly as stored on server  Same information displayed for all users, from all contexts  Dynamic.
Javascript Overview. What is Javascript? May be one of the most popular programming languages ever Runs in the browser, not on the server All modern browsers.
Web Programming Overview. Introduction HTML is limited - it cannot manipulate data How Web pages are extended (include): –Java: an object-oriented programming.
Understanding JavaScript and Coding Essentials Lesson 8.
JavaScript & Introduction to AJAX
Lesson 30: JavaScript and DHTML Fundamentals. Objectives Define and contrast client-side and server-side technologies used to create dynamic content for.
ASP Syntax Y.-H. Chen International College Ming-Chuan University Fall, 2004.
This is our seminar JavaScript And DOM This is our seminar JavaScript And DOM.
1 CSC160 Chapter 1: Introduction to JavaScript Chapter 2: Placing JavaScript in an HTML File.
The Web Wizard’s Guide To DHTML and CSS Chapter 2 A Review of CSS2 and JavaScript.
Introduction to Web Site Development Department of Computer Science California State University, Los Angeles Lecture 9: JavaScript.
DHTML.
Module 1 Introduction to JavaScript
W3C Web standards and Recommendations
JavaScript Introduction
JavaScript an introduction.
The Web Wizard’s Guide To JavaScript
Introduction to JavaScript
Introduction to DHTML, the DOM, JS review
JavaScript CS 4640 Programming Languages for Web Applications
Tutorial 10: Programming with javascript
JavaScript is a scripting language designed for Web pages by Netscape.
An Introduction to JavaScript
TypeScript (Microsoft)
TypeScript (Microsoft)
JavaScript CS 4640 Programming Languages for Web Applications
Presentation transcript:

JavaScript Introduction

Slide 2 Lecture Overview JavaScript background The purpose of JavaScript A first JavaScript example Introduction to getElementById

Slide 3 History Lesson JavaScript is NOT Java Started at Netscape in 1995 Microsoft released its own version 'JScript" in 1996 JavaScript is the default scripting language in.NET (VBScript has pretty much faded away)

Slide 4 What do we do with JavaScript? A starter list Adds sizzle to pages (Animation) Dynamic HTML Client side data entry validation Reduce the load on overburdened servers Process and manage cookies AJAX to load parts of Web pages jQuery layered on top of JavaScript

Slide 5 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-262 I’ll try to conform There are others It’s a “C ish” language

Slide 6 What is JavaScript (2) Most of what we do is to access the object model supported by the underlying browser The W3C defines the Document Object Model (DOM) Differences do exist between browsers I will try, where possible, to point out these differences Most support the common ECMA standards though

Slide 7 Creating a First Script tag appears in a or tag type argument denotes that it’s JavaScript type is no longer required in HTML 5 Example: document.write(“hello”);

Slide 8 Creating a First Script document.write(“hello") script tag End script tag Script language

Slide 9 Script Placement (1) A document may have multiple blocks Scripts in a block Create procedures here Before or after the section is fine Scripts in a block Code executes as the page is rendered Importing external script files This is the recommended place to put generic functions and way to create reusable libraries

Slide 10 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

Slide 11 Creating a First Script (Example) See JavaScriptExample1.htm Pay particular attention to the order in which the script code executes

Slide 12 Handling Java Incapable Browsers Include the directive to display a message when JavaScript is disabled document.write("Greetings") JavaScript is not enabled.

Slide 13 The document Object Recall that there exists a hierarchical in- memory representation of an HTML document This is maintained by the browser in the document object Much more later but the document object allows us to reference all the document’s elements

Slide 14 Using getElementById Is a key to working with JavaScript It gets a reference to an element having a specific value for the ID property That’s why ID must be unique Like a variable, it’s a unique identifier Once we have a reference to an element, we can call its methods and read / write its properties

Slide 15 Using getElementById (Example) Get a reference to the element whose ID property has a value of spnNumericVariables var v; v = document.getElementById( "spnNumericVariables");