JavaScript.

Slides:



Advertisements
Similar presentations
Chapter 08: Adding Adding Interactivity Interactivity With With Behaviors Behaviors By Bill Bennett Associate Professor MSJC CIS MVC.
Advertisements

JavaScript FaaDoOEngineers.com FaaDoOEngineers.com.
Java Script Session1 INTRODUCTION.
MSc. Publishing on WWW JavaScript. What is JavaScript? A scripting language devised by Netscape Adds functionality to web pages by: Embedding code into.
Tutorial 13 Working with Objects and Styles. XP Objectives Learn about objects and the document object model Reference documents objects by ID, name,
JavaScript Teppo Räisänen LIIKE/OAMK HTML, CSS, JavaScript HTML defines the structure CSS defines the layout JavaScript is used for scripting It.
Server vs Client-side validation. JavaScript JavaScript is an object-based language. JavaScript is based on manipulating objects by modifying an object’s.
JavaScript Defined DOM (Document Object Model) General Syntax Body vs. Head Variables Math & Logic Selection Functions & Events Loops Animation Getting.
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 II ECT 270 Robin Burke. Outline JavaScript review Processing Syntax Events and event handling Form validation.
CNIT 133 Interactive Web Pags – JavaScript and AJAX JavaScript Environment.
SERVER web page repository WEB PAGE instructions stores information and instructions BROWSER retrieves web page and follows instructions Server Web Server.
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.
CITS1231 Web Technologies JavaScript and Document Object Model.
JavaScript. Overview Introduction: JavaScript basics Expressions and types Expressions and types Arrays Arrays Objects and Associative Arrays Objects.
Extending HTML CPSC 120 Principles of Computer Science April 9, 2012.
CO1552 Web Application Development HTML Forms, Events and an introduction to JavaScript.
USING XML AS A DATA SOURCE. Data binding is a process by which information in a data source is stored as an object in computer memory. In this presentation,
JavaScript Syntax, how to use it in a HTML document
JavaScript - Basic Concepts Prepared and Presented by Hienvinh Nguyen, Afshin Tiraie.
44238: Dynamic Web-site Development Client Side Programming Ian Perry Room:C48 Extension:7287
Cs332a_chapt10.ppt CS332A Advanced HTML Programming DHTML Dynamic Hypertext Markup Language A term describing a series of technologies Not a stand-a-lone.
JavaScript Defined DOM (Document Object Model) General Syntax Body vs. Head Variables Math & Logic Selection Functions & Events Loops Animation Getting.
Web Programming Overview. Introduction HTML is limited - it cannot manipulate data How Web pages are extended (include): –Java: an object-oriented programming.
Host Objects: Browsers and the DOM
Understanding JavaScript and Coding Essentials Lesson 8.
Document Object Model Nasrullah. DOM When a page is loaded,browser creates a Document Object Model of the Page.
HTML DOM Basharat Mahmood, Department of Computer Science, CIIT, Islamabad, Pakistan 1.
Chapter 10 Dynamic HTML (DHTML) JavaScript, Third Edition.
Javascript Basic Concepts Presentation By: Er. Sunny Chanday Lecturer CSE/IT RBIENT.
CGS 3066: Web Programming and Design Spring 2016 Introduction to JavaScript.
JavaScript and Ajax (JavaScript Environment) Week 6 Web site:
Jackson, Web Technologies: A Computer Science Perspective, © 2007 Prentice-Hall, Inc. All rights reserved Chapter 5 Host Objects: Browsers.
COM621: Advanced Interactive Web Development Lecture 6 – JavaScript (cont.)
Tarik Booker CS 120 California State University, Los Angeles.
Introduction to JavaScript MIS 3502, Fall 2016 Jeremy Shafer Department of MIS Fox School of Business Temple University 9/29/2016.
Introduction to.
CGS 3066: Web Programming and Design Spring 2017
Web Basics: HTML/CSS/JavaScript What are they?
Javascript and Dynamic Web Pages: Client Side Processing
Applied Component I Unit II Introduction of java-script
Using DHTML to Enhance Web Pages
CIIT-Human Computer Interaction-CSC456-Fall-2015-Mr
Unit M Programming Web Pages with
Using JavaScript to Show an Alert
Tutorial 10 Programming with JavaScript
Week 4: Introduction to Javascript
JavaScript is a programming language designed for Web pages.
© 2015, Mike Murach & Associates, Inc.
JavaScript Event Handling.
Intro to JavaScript CS 1150 Spring 2017.
Section 17.1 Section 17.2 Add an audio file using HTML
Web Development & Design Foundations with HTML5 7th Edition
Getting web pages First we need to get the webpage by issuing a HTTP request. The best option for this is the requests library that comes with Anaconda:
Intro to PHP & Variables
Introduction to JavaScript
JavaScript Introduction
CT Web Development, Colorado State University
DHTML Javascript Internet Technology.
Web Programming A different world! Three main languages/tools No Java
Integrating JavaScript and HTML
DHTML Javascript Internet Technology.
Introduction to DHTML, the DOM, JS review
Introduction to JavaScript
JavaScript Basics What is JavaScript?
CNIT 133 Interactive Web Pags – JavaScript and AJAX
Web Programming and Design
Web Programming and Design
Presentation transcript:

JavaScript

Client-side Dynamic HTML Definition by behavior HTML Document Changes Client-Side. In response to user. Automatically, for example animation. Definition by example – Mix Client side scripting, e.g. JavaScript Page elements are object, e.g. DOM Properties of objects, e.g. CSS CT 310 - Web Development, Colorado State University May 21, 2019

Document Object Model Appropriate for this course: There is a lot going one here! Appropriate for this course: Common elements on a page, Including the page itself, Are objects to which actions may be attached. CT 310 - Web Development, Colorado State University May 21, 2019

JavaScript – Look Hither Do not confuse Java and JavaScript. Learning JavaScript. Where to start. Learn by example: zyBook The web We will not be going too deep. Mind security/convenience tradeoff. CT 310 - Web Development, Colorado State University May 21, 2019

CT 310 - Web Development, Colorado State University May 21, 2019

Hello World You may write to the document. CT 310 - Web Development, Colorado State University May 21, 2019

Hello World Page CT 310 - Web Development, Colorado State University May 21, 2019

Example 1 - Observations The script tag has ‘type’ attribute. Language attribute is depricated. Note the use of <noscript> tags. Arguably less important now, but … No accounting for older browsers. First taste of document object model. The document object has method ‘write’. CT 310 - Web Development, Colorado State University May 21, 2019

Example 2 Using CSS id’s to name objects. Accessing properties of objects. Assignment to variables. String concatenation. CT 310 - Web Development, Colorado State University May 21, 2019

Example 2 – The Page The printed URL is pulled from link. CT 310 - Web Development, Colorado State University May 21, 2019

Example 3 – Functions Usually in header or separate file. Definition syntax pretty standard. CT 310 - Web Development, Colorado State University May 21, 2019

First Taste of Power What is document.location.href ? It is the URL of the current window. It can be used to retrieve a URL. In our example it is on the left side of an assignment statement. … think about this … That is enough to switch the page! Fun, but not generally a good idea. CT 310 - Web Development, Colorado State University May 21, 2019

Example 3 - Events JavaScript is about exploiting events. Many events involve the mouse. For example, a click (up or down). Or, simply passing over an object. CT 310 - Web Development, Colorado State University May 21, 2019

Example 3 – The Page CT 310 - Web Development, Colorado State University May 21, 2019

Example 3 – The Page CT 310 - Web Development, Colorado State University May 21, 2019

Example 4 – More Functions Conditionals, recursion and return. Get in touch with ‘innerHTML’  CT 310 - Web Development, Colorado State University May 21, 2019

Try ‘return’ vs. ‘tab’ key Example 4 – Make it Go What makes this page do something? Think about object’s ‘enter’ and ‘num’. Assignment to ‘innerHTML’ is powerful. Caution Try ‘return’ vs. ‘tab’ key CT 310 - Web Development, Colorado State University May 21, 2019

Example 5 – Navigation Notice how the URL passes to goSite(). CT 310 - Web Development, Colorado State University May 21, 2019

Example 5 – The Page CT 310 - Web Development, Colorado State University May 21, 2019

Example 6 - Buttons CT 310 - Web Development, Colorado State University May 21, 2019

Example 6 – Window.open CT 310 - Web Development, Colorado State University May 21, 2019

Example 7 – Rollover Change the image based upon mouse. CT 310 - Web Development, Colorado State University May 21, 2019

Example 7 - Header Note the variables and image objects. CT 310 - Web Development, Colorado State University May 21, 2019

Example 7 – The Table Note that ‘display’ is the name of an image object on the page. Two types of mouse events. CT 310 - Web Development, Colorado State University May 21, 2019