An Introduction to JavaScript Summarized from Chapter 6 of “Web Programming: Building Internet Applications”, 3 rd Edition.

Slides:



Advertisements
Similar presentations
Essentials for Design JavaScript Level One Michael Brooks
Advertisements

JavaScript FaaDoOEngineers.com FaaDoOEngineers.com.
Java Script Session1 INTRODUCTION.
JavaScript Objects - DOM CST 200 JavaScript. Objectives Introduce JavaScript objects Introduce Document Object Model Introduce window object Introduce.
The Web Warrior Guide to Web Design Technologies
Java Applet & JavaScript SNU OOPSLA Lab. October 2005.
Server-Side vs. Client-Side Scripting Languages
1 Owais Mohammad Haq Department of Computer Science Eastern Michigan University April, 2005 Java Script.
JavaScript- Introduction. What it is and what it does? What it is? It is NOT Java It is NOT Server-side programming Users can see code It is a client-side.
ACTIVE X By Ethan Huang. OUTLINE What is ActiveX? Component of ActiveX Why ActiveX? ActiveX and Java Security Issue.
AdvWeb-1/29 DePaul University SNL 262 Advanced Web Page Design Introduction To JavaScript - II Instructor: David A. Lash.
Chapter 9 Introduction to the Document Object Model (DOM) JavaScript, Third Edition.
Web Development & Design Foundations with XHTML Chapter 14 Key Concepts.
Introduction to JavaScript. Aim To enable you to write you first JavaScript.
Copyright © Terry Felke-Morris WEB DEVELOPMENT & DESIGN FOUNDATIONS WITH HTML5 Chapter 14 Key Concepts 1 Copyright © Terry Felke-Morris.
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.
INTRODUCTION TO DHTML. TOPICS TO BE DISCUSSED……….  Introduction Introduction  UsesUses  ComponentsComponents  Difference between HTML and DHTMLDifference.
4.1 JavaScript Introduction
CS346 - Javascript 1, 21 Module 1 Introduction to JavaScript CS346.
HTML DOM.  The HTML DOM defines a standard way for accessing and manipulating HTML documents.  The DOM presents an HTML document as a tree- structure.
CNIT 133 Interactive Web Pags – JavaScript and AJAX JavaScript Environment.
JavaScript 1. What is JavaScript? JavaScript allows web authors to create dynamic pages that react to user interaction. It is an Object-based because.
Copyright © Terry Felke-Morris WEB DEVELOPMENT & DESIGN FOUNDATIONS WITH HTML5 Chapter 14 Key Concepts 1 Copyright © Terry Felke-Morris.
DOM and JavaScript Aryo Pinandito.
JavaScript Tabriz university Its September 1995.
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.
JavaScript, Fourth Edition
INTRODUCTION TO JAVASCRIPT AND DOM Internet Engineering Spring 2012.
Extending HTML CPSC 120 Principles of Computer Science April 9, 2012.
Javascript II DOM & JSON. In an effort to create increasingly interactive experiences on the web, programmers wanted access to the functionality of browsers.
JavaScript - A Web Script Language Fred Durao
JavaScript, jQuery, and Mashups Incorporating JavaScript, jQuery, and other Mashups into existing pages.
Client-side processing in JavaScript.... JavaScript history Motivations –lack of “dynamic content” on web pages animations etc user-customised displays.
1 JavaScript
Overview of Form and Javascript fundamentals. Brief matching exercise 1. This is the software that allows a user to access and view HTML documents 2.
Cs332a_chapt10.ppt CS332A Advanced HTML Programming DHTML Dynamic Hypertext Markup Language A term describing a series of technologies Not a stand-a-lone.
Web Pages with Features. Features on Web Pages Interactive Pages –Shows current date, get server’s IP, interactive quizzes Processing Forms –Serach a.
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.
HTML JAVASCRIPT. CONTENTS Javascript Example NOSCRIPT Tag Advantages Summary Exercise.
JavaScript Introduction. Slide 2 Lecture Overview JavaScript background The purpose of JavaScript A first JavaScript example Introduction to getElementById.
Java Script About Java Script Document Object Model Incorporating JavaScript Adding JavaScript to HTML Embedding a Javascript External Scripts Javascript.
JavaScript Overview Developer Essentials How to Code Language Constructs The DOM concept- API, (use W3C model) Objects –properties Methods Events Applications;
Copyright © Terry Felke-Morris WEB DEVELOPMENT & DESIGN FOUNDATIONS WITH HTML5 7 TH EDITION Chapter 14 Key Concepts 1 Copyright © Terry Felke-Morris.
Database Systems: Design, Implementation, and Management Eighth Edition Chapter 14 Database Connectivity and Web Technologies.
JavaScript 101 Introduction to Programming. Topics What is programming? The common elements found in most programming languages Introduction to JavaScript.
Tutorial 10 Programming with JavaScript. 2New Perspectives on HTML, XHTML, and XML, Comprehensive, 3rd Edition Objectives Learn the history of JavaScript.
JavaScript & Introduction to AJAX
Tutorial 10 Programming with JavaScript. 2New Perspectives on HTML, XHTML, and XML, Comprehensive, 3rd Edition Objectives Learn the history of JavaScript.
Chapter 4 Java Script - Part1. 2 Outlines Introduction to Java Script Variables, Operators and Functions Conditional statements JavaScript Objects Forms.
1 CSC160 Chapter 1: Introduction to JavaScript Chapter 2: Placing JavaScript in an HTML File.
Javascript Basic Concepts Presentation By: Er. Sunny Chanday Lecturer CSE/IT RBIENT.
The Web Wizard’s Guide To DHTML and CSS Chapter 2 A Review of CSS2 and JavaScript.
Web Programming Java Script-Introduction. What is Javascript? JavaScript is a scripting language using for the Web. JavaScript is a programming language.
Copyright © Terry Felke-Morris Web Development & Design Foundations with HTML5 8 th Edition CHAPTER 14 KEY CONCEPTS 1 Copyright.
Brief Look InTo JavaScript Dr. Thomas Hicks Computer Science Department Trinity University.
Javascript Javascript The JavaScript Programming Language – Scripting Languages Executed by an interpreter contained within.
DHTML.
Module 1 Introduction to JavaScript
JavaScripts.
Web Development & Design Foundations with HTML5
Donna J. Kain, Clarkson University
Web Development & Design Foundations with HTML5 7th Edition
14 A Brief Look at JavaScript and jQuery.
JavaScript Introduction
Introduction to JavaScript
Brief Look InTo JavaScript
Presentation transcript:

An Introduction to JavaScript Summarized from Chapter 6 of “Web Programming: Building Internet Applications”, 3 rd Edition

What is JavaScript? a dynamic, client-side scripting language  it is not compiled  it is not Java (from Sun) developed by Netscape  originally called LiveScript  When Java became popular – Netscape changed the name to JavaScript open language (no purchasing)

What is JavaScript? (cont.) Now managed by ECMA (European Computer Manufacturers Association) and adopted by ISO Since it is a client-side language, it works with a browser

What is JavaScript? (cont.) Pros  form validation (before sending to a server)  calculations  create custom HTML on- the-fly  test for plug-ins and other browser settings (does not work in IE after version 5.0; that function is now handled by ActiveX) Cons  cannot read local files (files on the client machine)  cannot write local file (except for cookies)  cannot read/write server files  can only close it’s own windows  can only read data from it’s own pages

JavaScript is Object-Oriented (?) Objects are things  In the world (cat, chair, car, etc.)  In browsers (window, button, title, etc.) Objects have properties  size, color, and position are all properties  Object are said to “have a” property Object have methods (or functions)  these are things that object do  click(), open(), selected() are methods Think of properties as being nouns Think of methods are being verbs

What is the DOM? Document Object Model  Developed by W3C but implemented differently in every browser.  “The Document Object Model is a platform- and language-neutral interface that will allow programs and scripts to dynamically access and update the content, structure and style of documents. The document can be further processed and the results of that processing can be incorporated back into the presented page. This is an overview of DOM-related materials here at W3C and around the web.” ( object properties methods

A Document Tree (node tree) downloaded from

A Worked Example text “My Page” text “This is text on my page” My Page This is text on my page

Hello, world!

Another couple of examples

Conditions (if statements) In order to validate to XHTML-Strict, you need to leave out ‘language=“javascript”. TRUE part FALSE part

Example A Simple Script (from text) navigator refers to the browser object alert creates a pop-up window document.write creates the content on a web page onLoad and onUnload are events

A Simple Script variation Inside the describe() function, change the document.write lines to display all of the data on a page instead of a pop-up

User Input Prompt the user and store the input as a variable You can include this in your page to notify the user that their JavaScript is disabled.