COMS 469: Interactive Media II

Similar documents
COMS 469: Interactive Media II

5/19/2015. Objectives. JavaScript, Sixth Edition. Introduction to the World Wide Web (cont d.) Introduction to the World Wide Web

COMS 359: Interactive Media

Introduction to JavaScript and the Web

Introduction to JavaScript and the Web

Lesson 1: Writing Your First JavaScript

JavaScript CS 4640 Programming Languages for Web Applications

Adding JavaScript to your web pages Referencing external JavaScript files Changing the background color of a web page

JavaScript code is inserted between tags, just like normal HTML tags:

JavaScript By: A. Mousavi & P. Broomhead SERG, School of Engineering Design, Brunel University, UK

Web Development & Design Foundations with HTML5, 8 th Edition Instructor Materials Chapter 14 Test Bank

Working with JavaScript

By the end of this section of the practical, the students should be able to:

CMPT 100 : INTRODUCTION TO

13. Databases on the Web

EXERCISE: Introduction to client side JavaScript

COMS 469: Interactive Media II

COMS 469: Interactive Media II

COMP284 Scripting Languages Lecture 14: JavaScript (Part 1) Handouts

INFS 2150 Introduction to Web Development and e-commerce Technology. Programming with JavaScript

Objectives. Introduction to JavaScript. Introduction to JavaScript INFS Peter Y. Wu, RMU 1

Time: 3 hours. Full Marks: 70. The figures in the margin indicate full marks. Answer from all the Groups as directed. Group A.

Chapter 11 Program Development and Programming Languages

Instructor s Notes Web Data Management Web Client/Server Concepts. Web Data Management Web Client/Server Concepts

Languages in WEB. E-Business Technologies. Summer Semester Submitted to. Prof. Dr. Eduard Heindl. Prepared by

JavaScript CS 4640 Programming Languages for Web Applications

JAVASCRIPT AND JQUERY: AN INTRODUCTION (WEB PROGRAMMING, X452.1)

COPYRIGHTED MATERIAL. Review of JavaScript history What JavaScript is How JavaScript and ECMAScript are related The different versions of JavaScript

Connecting with Computer Science Chapter 5 Review: Chapter Summary:

COMS 359: Interactive Media

8/19/2018. Web Development & Design Foundations with HTML5. Learning Objectives (1 of 2) Learning Objectives (2 of 2) What is JavaScript?

Agenda. My Introduction. CIS 154 Javascript Programming

UNIT 3 SECTION 1 Answer the following questions Q.1: What is an editor? editor editor Q.2: What do you understand by a web browser?

A Balanced Introduction to Computer Science, 3/E

CHAPTER 6 JAVASCRIPT PART 1

Lesson 5: Multimedia on the Web

Final-Term Papers Solved MCQS with Reference

Lesson 5: Introduction to Events

(Refer Slide Time: 01:40)

JavaScript: Introduction, Types

Manju Muralidharan Priya. CS4PM Web Aesthetics and Development WEEK 11

Enhancing Web Pages with JavaScript

IST 220: Application Layer

New Media Production Lecture 7 Javascript

Review. Fundamentals of Website Development. Web Extensions Server side & Where is your JOB? The Department of Computer Science 11/30/2015

1. Setup a root folder for the website 2. Create a wireframe 3. Add content 4. Create hyperlinks between pages and to external websites

Chapter. Web Applications

Discovering Computers Chapter 13 Programming Languages and Program Development

3. WWW and HTTP. Fig.3.1 Architecture of WWW

Boot Camp JavaScript Sioux, March 31, 2011

Web Design and Application Development

JavaScript Specialist v2.0 Exam 1D0-735

UNIT -II. Language-History and Versions Introduction JavaScript in Perspective-

Hypertext Markup Language, or HTML, is a markup

Ampliación de Bases de Datos

COSC 122 Computer Fluency. Programming Basics. Dr. Ramon Lawrence University of British Columbia Okanagan

CNIT 129S: Securing Web Applications. Ch 10: Attacking Back-End Components

Session 6. JavaScript Part 1. Reading

COMS 359: Interactive Media

JavaScript. IT Engineering I Instructor: Ali B. Hashemi

JavaScript. Why JavaScript? Dynamic Form Validation. Online calculator. IT Engineering I Instructor: Ali B. Hashemi. Interaction

Coding & Computation or What s all this about 1s and 0s? File: coding-computation-slides.tex.

6.170 Laboratory in Software Engineering Java Style Guide. Overview. Descriptive names. Consistent indentation and spacing. Page 1 of 5.

INT213. Active Server Pages using Visual Basic Scripting

Grading for Assignment #1

CERTIFICATE IN WEB PROGRAMMING

Web Development & Design Foundations with HTML5, 8 th Edition Instructor Materials Chapter 11 Test Bank

JavaScript I Language Basics

Assigns a number to 110,000 letters/glyphs U+0041 is an A U+0062 is an a. U+00A9 is a copyright symbol U+0F03 is an

d-file Language Reference Manual

Lesson 01 Introduction

CNIT 129S: Securing Web Applications. Ch 12: Attacking Users: Cross-Site Scripting (XSS) Part 2

INF5750. Introduction to JavaScript and Node.js

JavaScript Context. INFO/CSE 100, Spring 2005 Fluency in Information Technology.

Object Declaration. <class name>: the name of the class to which the object belongs <object name>: the name of the object (any valid identifier)

JavaScript by Vetri. Creating a Programmable Web Page

Syllabus. Instructor: Alexander Clayborne, (301) ,

JavaScript: Introductionto Scripting

JavaScript Introduction

Web Development & Design Foundations with HTML5

Ch04 JavaServer Pages (JSP)

CREATING JUMP SEARCHES WITH THE XACTSITE WEB SITES

Chapter 3 - Simple JavaScript - Programming Basics. Lesson 1 - JavaScript: What is it and what does it look like?

Internet: An international network of connected computers. The purpose of connecting computers together, of course, is to share information.

Basics of JavaScript. Last Week. Needs for Programming Capability. Browser as Development Platform. Using Client-side JavaScript. Origin of JavaScript

Chapter 101. Coding & Computation. Coding & Computation or What s all this about 1s and 0s? Topics


Section 1. How to use Brackets to develop JavaScript applications

Information Systems Software

HTML4 TUTORIAL PART 2

JavaScript Functions, Objects and Array

Netscape Introduction to the JavaScript Language

Chapter 7:- PHP. Compiled By:- Sanjay Patel Assistant Professor, SVBIT.

Objects and Classes Lecture 1

The course also includes an overview of some of the most popular frameworks that you will most likely encounter in your real work environments.

The Computer System. Hardware = Physical Computer. Software = Computer Programs. People = End Users & Programmers. people

COMSC-030 Web Site Development- Part 1. Part-Time Instructor: Joenil Mistal

is Introduction to HTML

Introduction to Engineering Using Robotics Experiments. Dr. Yinong Chen


Transcription:

COMS 469: Interactive Media II

Agenda Class Roster Course Web Site & Syllabus JavaScript Introduction (ch. 1)

gunkelweb.com/coms469

Introduction to JavaScript Chapter One Introduction to JavaScript and the Web

Introduction to JavaScript Definitions/Terminology JavaScript is a kind of computer language Computer Language Series of instructions (also called code) that tell a computer what to do These instructions are processed by the computer. This is called executing or running the code. Instructions/code for making instant coffee

Introduction to JavaScript Executable Binary Code Human readable/writeable code

Introduction to JavaScript Two Methods of making the conversion program Hello; Compiler 0011001 1100110 1001010 Executable Binary Code begin Write('Hello world'); end. 0011001 Source Code Interpreter 1100110 1001010

Introduction to JavaScript Scripting Languages Interpreted language for web applications Two kinds Client Side Scripting Script is embedded in an HTML document and interpreted by the user s browser i.e. JavaScript, VBScript JavaScript client side scripting Server Side Scripting Script code is interpreted on the server and the results are delivered to the user s web browser i.e. PHP, ASP, Perl PHP server side scripting

Introduction to JavaScript JavaScript is a client side scripting language Browsers have a built-in JavaScript Interpreter This Interpreter takes the JavaScript code embedded in an HTML document and turns it into executable machine code

Introduction to JavaScript JavaScript History JavaScript was introduced in 1995 by Netscape; originally it was called LiveScript Changed name to JavaScript in order to capitalize on the popularity of Java Netscape s JavaScript is based on the ECMA-262 Edition 3 standard scripting language.

Introduction to JavaScript JavaScript History Despite the similarity in name, JavaScript is NOT a scripting version of Java Java Sun Microsystems / Oracle Full-featured programming language like C++

Introduction to JavaScript JavaScript History Different versions JavaScript JScript Although these different brands or versions of JavaScript are substantial similar, there are enough differences to cause some cross-browser incompatibility issues.

Introduction to JavaScript Why JavaScript? Compatibility Easy to learn and use Powerful/Practical Lucrative

Introduction to JavaScript Why JavaScript? Compatibility Firefox Safari M$-IE Server JavaScript VBScript Perl PHP

Introduction to JavaScript Why JavaScript? Easy to Learn and Use Interpreted Embedded in HTML Runs locally Good transition language

Introduction to JavaScript Why JavaScript? Powerful/Practical Interact with Users Work with Forms Image Manipulation User Customization DHTML AJAX Web 2.0 Aps

Introduction to JavaScript Why JavaScript? Lucrative

Introduction to JavaScript JavaScript Tools Text Editor NotePad NotePad++ or TextWrangler http://notepad-plus-plus.org/ http://www.barebones.com/products/textwrangler/ Browser M$-IE Firefox Safari USB Jump Drive

Introduction to JavaScript JavaScript & Browsers Enable/Disable JavaScript

Writing JavaScript Terminology JavaScript is an Object-Oriented language Object-Oriented Terminology Object Properties Methods

Writing JavaScript Terminology Object = Web Browser Elements Window Document Forms Images

Writing JavaScript Terminology Properties Items belonging to a web browser object Further define an object; changing a property can alter the object Examples Documents have titles Forms have checkboxes Windows have a location

Writing JavaScript Terminology Methods = Object behaviors Specifies what an object does or how it functions Examples Buttons click( ) Windows open( ) Documents write( ) the ( ) occurs with all JavaScript methods; often times additional information (called an argument) is placed inside the parenthesis

Writing JavaScript Terminology Objects, Properties and Methods are put together to create instructions Dot-Syntax Object.property document.bgcolor window.status Object.method( ) document.write( )

JavaScript Object Table Complete list of all JavaScript objects & their associated properties and methods

Writing JavaScript Case Sensitivity HTML is not case sensitive <html> = <HTML> = <Html> JavaScript is case sensitive bgcolor bgcolor BgColor BGCOLOR

Writing JavaScript JavaScript code is placed within an HTML document. It can go either in the <head> or the <body>.

Writing JavaScript <script> Differentiate JavaScript code from HTML by using the <script> container tag. This tag has one required attribute, which specifies the type of scripting language. <script> tells the browser to interpret the following lines of code as script and not as HTML

Writing JavaScript JavaScript code Change the bgcolor property of the document object by setting its value to an hexadecimal number. The equals sign assigns the hex number value to the bgcolor property. The value is in quotation marks. The end of a line of code is indicated with a semi-colon.

Writing JavaScript Closing script tag. Tells the browser to stop interpreting JavaScript code and return to displaying HTML

Writing JavaScript Exercise #1 Results: JavaScript code changes the background color of the page

Writing JavaScript Parsing Browser reads the HTML code from top to bottom It first sets the bgcolor to white and then interprets the JavaScript code which sets it to red

Parsing Example

When the page first opens, the bgcolor is set by the HTML code to white. The first script tag employs an alert( ) function which halts the parsing of the page at this point. The alert( ) function takes a text string as its parameter. A text string is a bit of text that is contained by quotation marks. Before the alert( ) function, we include a comment. JavaScript comments are preceded by double slashes.

After the user clicks the alert box s OK button, the parsing continues and encounters a second script tag. This second script tag changes the bgcolor to red and uses a second alert( ) function which again halts the parsing of the page.

After the user clicks the alert box s OK button, the parsing continues to the end of the page and displays the last line of HTML code on the red background.

Exercise #2

Review Exercise

Review Exercise Hint: There is more than one way to get this result

Preview Javascript Ch. 2: Data Types and Variables (pp. 17-50) Ch. 3: Decisions, Loops, & Functions (pp. 51-86)