 2004 Prentice Hall, Inc. All rights reserved. Chapter 12 - JavaScript: Objects Outline 12.1 Introduction 12.2 Thinking About Objects 12.3 Math Object.

Slides:



Advertisements
Similar presentations
JavaScript I. JavaScript is an object oriented programming language used to add interactivity to web pages. Different from Java, even though bears some.
Advertisements

Introducing JavaScript
 2008 Pearson Education, Inc. All rights reserved JavaScript: Objects.
 2001 Prentice Hall, Inc. All rights reserved. 1 Chapter 7 - JavaScript: Introduction to Scripting Outline 7.1 Introduction 7.2 Simple Program: Printing.
Session 8 JavaScript/Jscript: Objects Matakuliah: M0114/Web Based Programming Tahun: 2005 Versi: 5.
Outline IS400: Development of Business Applications on the Internet Fall 2004 Instructor: Dr. Boris Jukic JavaScript: Introduction to Scripting.
 2008 Pearson Education, Inc. All rights reserved JavaScript: Introduction to Scripting.
6.1 JavaScript Objects and Object- Oriented Programming (OOP)
1 JavaScript/Jscript 6 Objects. 2 Introduction Up till now –JavaScript used to illustrate basic programming concepts JavaScript can also –Manipulate every.
ASP.NET Programming with C# and SQL Server First Edition
Introduction to scripting
 2004 Prentice Hall, Inc. All rights reserved. Chapter 25 – Perl and CGI (Common Gateway Interface) Outline 25.1 Introduction 25.2 Perl 25.3 String Processing.
Advanced Programming Collage of Information Technology University of Palestine, Gaza Prepared by: Mahmoud Rafeek Alfarra Lecture 16: Working with Text.
JavaScript: Control Structures September 27, 2005 Slides modified from Internet & World Wide Web: How to Program (3rd) edition. By Deitel, Deitel,
 2004 Prentice Hall, Inc. All rights reserved. Chapter 7 - JavaScript: Introduction to Scripting Outline 7.1 Introduction 7.2 Simple Program: Printing.
 2004 Prentice Hall, Inc. All rights reserved. Chapter 35 – Python Outline 35.1 Introduction First Python Program Python Keywords 35.2 Basic.
 2003 Prentice Hall, Inc. All rights reserved. CHAPTER 3 JavaScript 1.
 2004 Prentice Hall, Inc. All rights reserved. Chapter 13 - Dynamic HTML: Object Model and Collections Outline 13.1 Introduction 13.2 Object Referencing.
Test Automation For Web-Based Applications Portnov Computer School Presenter: Ellie Skobel.
JavaScript, Fourth Edition
1 JavaScript: Objects and Object Models October 25, 2005 Slides modified from Internet & World Wide Web: How to Program (3rd) edition. By Deitel,
 2002 Prentice Hall, Inc. All rights reserved.2 Chapter 2 — Introduction to HyperText Markup Language 4: Part I Outline 2.1Introduction 2.2Markup Languages.
 2001 Prentice Hall, Inc. All rights reserved. 1 Chapter 7 - JavaScript: Introduction to Scripting Outline 7.1 Introduction 7.2 Simple Program: Printing.
JavaScript: Objects Outline 12.1 Introduction 12.2 Thinking About Objects 12.3 Math Object 12.4 String Object Fundamentals of Characters and Strings.
Chapter 8 Cookies And Security JavaScript, Third Edition.
XP Tutorial 10New Perspectives on Creating Web Pages with HTML, XHTML, and XML 1 Working with JavaScript Creating a Programmable Web Page for North Pole.
 2008 Pearson Education, Inc. All rights reserved JavaScript: Functions.
 2003 Prentice Hall, Inc. All rights reserved. CHAPTER 3 JavaScript 1.
 2008 Pearson Education, Inc. All rights reserved JavaScript: Objects.
A Balanced Introduction to Computer Science, 3/E David Reed, Creighton University ©2011 Pearson Prentice Hall ISBN Chapter 15 JavaScript.
 2003 Prentice Hall, Inc. All rights reserved. Introduction to HTML: Frames Outline 1 Introduction 2 frameset Element 3 Nested frameset s 4 Web Resources.
 2004 Prentice Hall, Inc. All rights reserved. Chapter 16 - Dynamic HTML: Data Binding with Tabular Data Control Outline 16.1 Introduction 16.2 Simple.
T U T O R I A L  2009 Pearson Education, Inc. All rights reserved Screen Scraping Application Introducing String Processing.
 2000 Deitel & Associates, Inc. All rights reserved. Chapter 13 – JavaScript/Jscript: Objects Outline 13.1Introduction 13.2Thinking About Objects 13.3.
XP Tutorial 10New Perspectives on HTML and XHTML, Comprehensive 1 Working with JavaScript Creating a Programmable Web Page for North Pole Novelties Tutorial.
Project 1: Using Arrays and Manipulating Strings Essentials for Design JavaScript Level Two Michael Brooks.
Internet & World Wide Web How to Program, 5/e © by Pearson Education, Inc. All Rights Reserved.
Internet & World Wide Web How to Program, 5/e. 2.
Internet & World Wide Web How to Program, 5/e © by Pearson Education, Inc. All Rights Reserved.
 2001 Deitel & Associates, Inc. All rights reserved. 1 Chapter 18 – JavaScript/Jscript: Objects Outline 18.1Introduction 18.2Thinking About Objects 18.3.
 2008 Pearson Education, Inc. All rights reserved JavaScript: Introduction to Scripting.
COP 3813 Intro to Internet Computing Prof. Roy Levow Lecture 4 JavaScript.
Internet & World Wide Web How to Program, 5/e © by Pearson Education, Inc. All Rights Reserved.
 2003 Prentice Hall, Inc. All rights reserved. Chapter 7 - JavaScript: Introduction to Scripting Outline 7.1 Introduction 7.2 Simple Program: Printing.
Chapter 7 - JavaScript: Introduction to Scripting Outline 7.1 Introduction 7.2 Simple Program: Printing a Line of Text in a Web Page 7.3 Another JavaScript.
 2008 Pearson Education, Inc. All rights reserved JavaScript: Introduction to Scripting.
JavaScript: Objects 1 © by Pearson Education, Inc. All Rights Reserved.
JavaScript: Objects 1 © by Pearson Education, Inc. All Rights Reserved.
Project 5: Customizing User Content Essentials for Design JavaScript Level Two Michael Brooks.
Strings, Characters, and Regular Expressions Session 10 Mata kuliah: M0874 – Programming II Tahun: 2010.
 2001 Prentice Hall, Inc. All rights reserved. 1 Chapter 12 - JavaScript: Objects Outline 12.1 Introduction 12.2 Thinking About Objects 12.3 Math Object.
REEM ALMOTIRI Information Technology Department Majmaah University.
XP Tutorial 10New Perspectives on HTML, XHTML, and DHTML, Comprehensive 1 Working with JavaScript Creating a Programmable Web Page for North Pole Novelties.
 2001 Prentice Hall, Inc. All rights reserved. Outline 1 JavaScript.
1 A Balanced Introduction to Computer Science, 2/E David Reed, Creighton University ©2008 Pearson Prentice Hall ISBN Chapter 15 JavaScript.
Java Script: Objects (Chapter 12 in [2]). 2 Outline Introduction Introduction Thinking About Objects Thinking About Objects Math Object Math Object String.
11 JavaScript: Objects.
Chapter 18 – JavaScript/Jscript: Objects
Chapter 6 JavaScript: Introduction to Scripting
JavaScript Objects.
Introduction to Scripting
JavaScript: Objects.
Primitive Types Vs. Reference Types, Strings, Enumerations
Chapter 12 - JavaScript: Objects
WEB PROGRAMMING JavaScript.
Chapter 12 - JavaScript: Objects
JavaScript: Objects.
Chapter 12 - JavaScript: Objects
JavaScript: Introduction to Scripting
11 JavaScript: Objects.
Presentation transcript:

 2004 Prentice Hall, Inc. All rights reserved. Chapter 12 - JavaScript: Objects Outline 12.1 Introduction 12.2 Thinking About Objects 12.3 Math Object 12.4 String Object Fundamentals of Characters and Strings Methods of the String Object Character-Processing Methods Searching Methods Splitting Strings and Obtaining Substrings XHTML Markup Methods 12.5 Date Object 12.6 Boolean and Number Objects 12.7 document Object 12.8 window Object 12.9 Using Cookies Final JavaScript Example Web Resources

 2004 Prentice Hall, Inc. All rights reserved Introduction Use JavaScript to manipulate every element of XHTML document from a script Reference for several of JavaScript’s built-in objects Demonstrates the capabilities

 2004 Prentice Hall, Inc. All rights reserved Thinking About Objects Objects –Attributes –Behaviors –Encapsulate date and methods –Property of information hiding –Details hidden within the objects themselves

 2004 Prentice Hall, Inc. All rights reserved Math Object Allow the programmer to perform many common mathematical calculations

 2004 Prentice Hall, Inc. All rights reserved Math Object Fig Math object methods.

 2004 Prentice Hall, Inc. All rights reserved Math Object

 2004 Prentice Hall, Inc. All rights reserved Math Object

 2004 Prentice Hall, Inc. All rights reserved String Object JavaScript’s string and character-processing capabilities Appropriate for processing names, addresses, credit card information, etc.

 2004 Prentice Hall, Inc. All rights reserved Fundamentals of Characters and Strings Characters –Fundamental building blocks of JavaScript programs String –Series of characters treated as a single unit

 2004 Prentice Hall, Inc. All rights reserved Methods of the String Object Fig String object methods.

 2004 Prentice Hall, Inc. All rights reserved Methods of the String Object Fig String object methods.

 2004 Prentice Hall, Inc. All rights reserved Methods of the String Object

 2004 Prentice Hall, Inc. All rights reserved Character Processing Methods charAt –Returns the character at specific position charCodeAt –Returns Unicode value of the character at specific position fromCharCode –Returns string created from series of Unicode values toLowerCase –Returns lowercase version of string toUpperCase –Returns uppercase version of string

 2004 Prentice Hall, Inc. All rights reserved. Outline CharacterProcessing. html 1 of 2

 2004 Prentice Hall, Inc. All rights reserved. Outline CharacterProcessing. html 2 of 2

 2004 Prentice Hall, Inc. All rights reserved Searching Methods indexOf and lastIndexOf –Search for a specified substring in a string

 2004 Prentice Hall, Inc. All rights reserved. Outline SearchingStrings.html 1 of 3

 2004 Prentice Hall, Inc. All rights reserved. Outline SearchingStrings.html 2 of 3

 2004 Prentice Hall, Inc. All rights reserved. Outline SearchingStrings.html 3 of 3

 2004 Prentice Hall, Inc. All rights reserved.

Splitting Strings and Obtaining Substrings Tokenization –The process of breaking a string into tokens Tokens –Individual words –Separated by delimiters

 2004 Prentice Hall, Inc. All rights reserved. Outline SplitAndSubString.html 1 of 2

 2004 Prentice Hall, Inc. All rights reserved. Outline SplitAndSubString.html 2 of 2

 2004 Prentice Hall, Inc. All rights reserved.

XHTML Markup Methods Anchor – Anchor Blink – blinking text Fixed – monospaced text Strike – strike out text Subscript – subscript Superscript – superscript

 2004 Prentice Hall, Inc. All rights reserved. Outline MarkupMethods.html 1 of 2

 2004 Prentice Hall, Inc. All rights reserved. Outline MarkupMethods.html 2 of 2

 2004 Prentice Hall, Inc. All rights reserved Date Object Provides methods for date and time manipulations

 2004 Prentice Hall, Inc. All rights reserved Date Object

 2004 Prentice Hall, Inc. All rights reserved Date Object

 2004 Prentice Hall, Inc. All rights reserved Date Object

 2004 Prentice Hall, Inc. All rights reserved. Outline DateTime.html 1 of 3

 2004 Prentice Hall, Inc. All rights reserved. Outline DateTime.html 2 of 3

 2004 Prentice Hall, Inc. All rights reserved. Outline DateTime.html 3 of 3

 2004 Prentice Hall, Inc. All rights reserved Boolean and Number Objects Object wrappers for boolean true / false values and numbers

 2004 Prentice Hall, Inc. All rights reserved Boolean and Number Objects

 2004 Prentice Hall, Inc. All rights reserved Boolean and Number Objects

 2004 Prentice Hall, Inc. All rights reserved document Object Manipulate document that is currently visible in the browser window

 2004 Prentice Hall, Inc. All rights reserved document Object

 2004 Prentice Hall, Inc. All rights reserved window Object Provides methods for manipulating browser window

 2004 Prentice Hall, Inc. All rights reserved. Outline window.html 1 of 7

 2004 Prentice Hall, Inc. All rights reserved. Outline window.html 2 of 7

 2004 Prentice Hall, Inc. All rights reserved. Outline window.html 3 of 7

 2004 Prentice Hall, Inc. All rights reserved. Outline window.html 4 of 7

 2004 Prentice Hall, Inc. All rights reserved. Outline window.html 5 of 7

 2004 Prentice Hall, Inc. All rights reserved. Outline window.html 6 of 7

 2004 Prentice Hall, Inc. All rights reserved. Outline window.html 7 of 7

 2004 Prentice Hall, Inc. All rights reserved.

12.8 window Object

 2004 Prentice Hall, Inc. All rights reserved Using Cookies Cookie –Data stored on user’s computer to maintain information about client during and between browser sessions –Can be accessed through cookie property –Set expiration date through expires property –Use escape function to convert non-alphanumeric characters to hexadecimal escape sequences –unescape function converts hexadecimal escape sequences back to English characters

 2004 Prentice Hall, Inc. All rights reserved. Outline cookie.html 1 of 4

 2004 Prentice Hall, Inc. All rights reserved. Outline cookie.html 2 of 4

 2004 Prentice Hall, Inc. All rights reserved. Outline cookie.html 3 of 4

 2004 Prentice Hall, Inc. All rights reserved. Outline cookie.html 4 of 4

 2004 Prentice Hall, Inc. All rights reserved Final JavaScript Example Combines concepts discussed previously

 2004 Prentice Hall, Inc. All rights reserved. Outline final.html 1 of 6

 2004 Prentice Hall, Inc. All rights reserved. Outline final.html 2 of 6

 2004 Prentice Hall, Inc. All rights reserved. Outline final.html 3 of 6

 2004 Prentice Hall, Inc. All rights reserved. Outline final.html 4 of 6

 2004 Prentice Hall, Inc. All rights reserved. Outline final.html 5 of 6

 2004 Prentice Hall, Inc. All rights reserved. Outline final.html 6 of 6

 2004 Prentice Hall, Inc. All rights reserved.

Outline quiz2.html 1 of 3

 2004 Prentice Hall, Inc. All rights reserved. Outline quiz2.html 2 of 3

 2004 Prentice Hall, Inc. All rights reserved. Outline quiz2.html 3 of 3

 2004 Prentice Hall, Inc. All rights reserved.

12.11 Web Resources