Object-based Programming in JavaScript By Katie Horn.

Slides:



Advertisements
Similar presentations
The Web Wizards Guide To JavaScript Chapter 1 JavaScript Basics.
Advertisements

JavaScript I. JavaScript is an object oriented programming language used to add interactivity to web pages. Different from Java, even though bears some.
Sue Wills July Objects The JavaScript language is completely centered around objects, and because of this, it is known as an Object Oriented Programming.
JavaScript FaaDoOEngineers.com FaaDoOEngineers.com.
Javascript It’s not JAVA. What do these all have in common?
JavaScript Objects - DOM CST 200 JavaScript. Objectives Introduce JavaScript objects Introduce Document Object Model Introduce window object Introduce.
Authoring Languages and Web Authoring Software 4.01 Examine web page development and design.
The Web Warrior Guide to Web Design Technologies
Chapter 9 Introduction to the Document Object Model (DOM) JavaScript, Third Edition.
Tutorial 13 Working with Objects and Styles. XP Objectives Learn about objects and the document object model Reference documents objects by ID, name,
CSC 2720 Building Web Applications JavaScript. Introduction  JavaScript is a scripting language most often used for client-side web development.  JavaScript.
C++ fundamentals.
4.01B Authoring Languages and Web Authoring Software 4.01 Examine webpage development and design.
Copyright Penny McIntire, Scripting Languages and the DOM.
CST JavaScript Validating Form Data with 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
JavaScript and The Document Object Model MMIS 656 Web Design Technologies Acknowledgements: 1.Notes from David Shrader, NSU GSCIS 2.Some material adapted.
Chapter 5 Java Script And Forms JavaScript, Third Edition.
Introduction to JavaScript 11 Introduction to Programming the WWW I CMSC Winter 2004 Lecture 14.
J AVA S CRIPT Shadi Banitaan 1. O UTLINE Introduction JavaScript Functions Using Objects in JavaScript Built-in Objects User-Defined Objects Examples.
CNIT 133 Interactive Web Pags – JavaScript and AJAX JavaScript Environment.
Javascript Languages By Rapee kamoltalapisek ID:
Functions and Objects. First Midterm exam Date: October 8, 2008 Content: Two parts: On-paper:Multiple choices On-computer: Write codes Cover everything.
Working with Objects Creating a Dynamic Web Page.
CITS1231 Web Technologies JavaScript and Document Object Model.
Client Scripting1 Internet Systems Design. Client Scripting2 n “A scripting language is a programming language that is used to manipulate, customize,
Tutorial 2 Variables and Objects. Working with Variables and Objects Variables (or identifiers) –Values stored in computer memory locations –Value can.
Section 17.1 Add an audio file using HTML Create a form using HTML Add text boxes using HTML Add radio buttons and check boxes using HTML Add a pull-down.
JavaScript, Fourth Edition
INTRODUCTION TO JAVASCRIPT AND DOM Internet Engineering Spring 2012.
Chapter 6 Object-Oriented Java Script JavaScript, Third Edition.
Javascript II DOM & JSON. In an effort to create increasingly interactive experiences on the web, programmers wanted access to the functionality of browsers.
DHTML: Working with Objects Creating a Dynamic Web Page.
JavaScript Shopping Cart Yong Choi CSU Bakersfield.
Introduction to Programming the WWW I CMSC Summer 2003 Lecture 7.
IS2802 Introduction to Multimedia Applications for Business Lecture 1: Introduction to IS2802 Rob Gleasure
JavaScript Syntax, how to use it in a HTML document
David Lawrence 7/8/091Intro. to PHP -- David Lawrence.
TOPIC II Dynamic HTML Prepared by: Nimcan Cabd Cali.
INTRODUCTION JavaScript can make websites more interactive, interesting, and user-friendly.
IS2803 Developing Multimedia Applications for Business (Part 2) Lecture 2: Introduction to IS2803 Rob Gleasure
Lesson 30: JavaScript and DHTML Fundamentals. Objectives Define and contrast client-side and server-side technologies used to create dynamic content for.
JavaScript Katie Fowle November 15, History Brendan Eich at Netscape, 1995 Need for interactivity in web pages Mocha, LiveWire, LiveScript, then.
Introduction to JavaScript LIS390W1A Web Technologies and Techniques 24 Oct M. Cameron Jones.
Javascript Basic Concepts Presentation By: Er. Sunny Chanday Lecturer CSE/IT RBIENT.
XML DOM Week 11 Web site:
JavaScript: A short introduction Joseph Lee Created by Joseph Lee.
PHP is a server scripting language, and a powerful tool for making dynamic and interactive Web pages. PHP is a widely-used, free, and efficient alternative.
Java Script and the DOM DOM stands for: –The Document Object Model When a browser reads a web page, it converts it’s contents from HTML into a hierarchical.
Web Security (cont.) 1. Referral issues r HTTP referer (originally referrer) – HTTP header that designates calling resource  Page on which a link is.
Applications Active Web Documents Active Web Documents.
DHTML.
Applied Component I Unit II Introduction of java-script
CIIT-Human Computer Interaction-CSC456-Fall-2015-Mr
Section 17.1 Section 17.2 Add an audio file using HTML
Web Development & Design Foundations with HTML5 7th Edition
Introduction to JavaScript
JavaScript Introduction
JavaScript an introduction.
The Web Wizard’s Guide To JavaScript
DHTML Javascript Internet Technology.
DHTML Javascript Internet Technology.
Unit 6 part 3 Test Javascript Test.
JavaScript CS 4640 Programming Languages for Web Applications
[Robert W. Sebesta, “Programming the World Wide Web
Hypertext Preprocessor
Introduction to JavaScript
Creating dynamic/interactive web pages
JavaScript CS 4640 Programming Languages for Web Applications
Presentation transcript:

Object-based Programming in JavaScript By Katie Horn

JavaScript is not Java. JavaScript was developed as a web-based scripting language which would exist exclusively on the World Wide Web. It was designed for short scripts which would be easily editable by web developers. The only relation JavaScript bears to its namesake is a similar syntax.

Object-oriented? To qualify as object-oriented, programming languages must provide support for the following: Data Abstraction Encapsulation Data protection Inheritance

JavaScript is not an object- oriented language. JavaScript does not support data abstraction in the form of Classes, neither is there support for data protection. However, JavaScript is defined as an object- based language.

The JavaScript Object Objects in JavaScript are merely lists of properties, functions, and other objects There are three types of objects in JavaScript: Native: strictly defined within the language. (Number, String, Image, ect.) Host: Pre-defined by another source. Related to the script’s environment. User-defined

Host Objects Very often, JavaScript is used to interact with the DOM (Document Object Model), a hierarchy of all objects in a web document. Manipulating the DOM is one way to create dynamic web content. Every web browser can have its own version of the DOM, which can make scripting a bit problematic.

User-defined objects Users can define their own objects by writing a constructor function… function Frog(name, color) { this.name = name; this.color = color; } …and instantiating that function. var myFrog = new Frog(“Mothra II”, “#004400”)

User-defined objects You may add, remove, or alter your object’s properties and methods at any time: myFrog.size = “10px” myFrog.kid = new Frog(“Mothra III”, “#337F00”) Function sing(){ Document.write(“It’s not easy being ”) Document.write(this.color) } myFrog.croak = sing Delete myFrog.size

User-Defined Objects While you can instantiate an object many times, the individual objects can be changed to anything at will. Objects instantiated by the same constructor won’t necessarily bear any resemblance to eachother. There is no way to check two objects for similar ‘type’.

JavaScript: Object Based Objects are at the very heart of JavaScript. It is a language created to alter things that have already been defined. Objects drive the language, and it is impossible to write useful JavaScript without them.