Web Programming Material From Greenlaw/Hepp, In-line/On-line: Fundamentals of the Internet and the World Wide Web 1 Introduction The JavaScript Programming.

Slides:



Advertisements
Similar presentations
Java Script Session1 INTRODUCTION.
Advertisements

The Web Warrior Guide to Web Design Technologies
1 A Balanced Introduction to Computer Science, 2/E David Reed, Creighton University ©2008 Pearson Prentice Hall ISBN Chapter 7 Event-Driven.
Javascript Document Object Model. How to use JavaScript  JavaScript can be embedded into your html pages in a couple of ways  in elements in both and.
JavaScript 101 Lesson 5: Introduction to Events. Lesson Topics Event driven programming Events and event handlers The onClick event handler for hyperlinks.
Web Development & Design Foundations with XHTML Chapter 14 Key Concepts.
Tutorial 6 Forms Section A - Working with Forms in JavaScript.
Copyright © Terry Felke-Morris WEB DEVELOPMENT & DESIGN FOUNDATIONS WITH HTML5 Chapter 14 Key Concepts 1 Copyright © Terry Felke-Morris.
CST JavaScript Validating Form Data with JavaScript.
1 Events Lect 8. 2 Event-driven Pages one popular feature of the Web is its interactive nature e.g., you click on buttons to make windows appear e.g.,
Javascript and the Web Whys and Hows of Javascript.
4.1 JavaScript Introduction
_______________________________________________________________________________________________________________ E-Commerce: Fundamentals and Applications1.
CNIT 133 Interactive Web Pags – JavaScript and AJAX Event and Event Handling.
Introduction to JavaScript. JavaScript Facts A scripting language - not compiled but interpreted line by line at run-time. Platform independent. It is.
Chapter 5 Java Script And Forms JavaScript, Third Edition.
Chapter 6: Forms JavaScript - Introductory. Previewing the Product Registration Form.
XHTML Introductory1 Forms Chapter 7. XHTML Introductory2 Objectives In this chapter, you will: Study elements Learn about input fields Use the element.
Generations of Programming Languages First generation  Machine Language Second Generation  Assembly Language Third Generation  Procedural language such.
1 CS101 Introduction to Computing Lecture 18 Objects, Properties, Methods (Web Development Lecture 6)
CNIT 133 Interactive Web Pags – JavaScript and AJAX JavaScript Environment.
JavaScript Part 1.
Copyright © Terry Felke-Morris WEB DEVELOPMENT & DESIGN FOUNDATIONS WITH HTML5 Chapter 14 Key Concepts 1 Copyright © Terry Felke-Morris.
CSS Class 7 Add JavaScript to your page Add event handlers Validate a form Open a new window Hide and show elements Swap images Debug JavaScript.
What is Java Script? An extension to HTML. An extension to HTML. Allows authors to incorporate some functionality in their web pages. (without using CGI.
Introduction to Applets CS 3505 Client Side Scripting with applets.
Lesson13. JavaScript JavaScript is an interpreted language, designed to function within a web browser. It can also be used on the server.
INTRODUCTION TO JAVASCRIPT AND DOM Internet Engineering Spring 2012.
Extending HTML CPSC 120 Principles of Computer Science April 9, 2012.
Introduction to JavaScript 41 Introduction to Programming the WWW I CMSC Winter 2004 Lecture 17.
JavaScript, Fourth Edition Chapter 5 Validating Form Data with JavaScript.
Active Server Pages  In this chapter, you will learn:  How browsers and servers interacted on the Internet when the Internet first became popular 
1 © Netskills Quality Internet Training, University of Newcastle HTML Forms © Netskills, Quality Internet Training, University of Newcastle Netskills is.
JavaScript - A Web Script Language Fred Durao
HTML Form Widgets. Review: HTML Forms HTML forms are used to create web pages that accept user input Forms allow the user to communicate information back.
1 JavaScript
JavaScript - Basic Concepts Prepared and Presented by Hienvinh Nguyen, Afshin Tiraie.
Introduction to JavaScript CS101 Introduction to Computing.
44238: Dynamic Web-site Development Client Side Programming Ian Perry Room:C48 Extension:7287
JavaScript Scripting language What is Scripting ? A scripting language, script language, or extension language is a programming language.
Scott Marino MSMIS Summer Session Web Site Design and Authoring Session 8 Scott Marino.
Chapter 2: Variables, Functions, Objects, and Events JavaScript - Introductory.
Introduction to JavaScript Objects, Properties, Methods.
Chapter 4 Applets Cop Why Applets? WWW makes huge information available to anyone with web browser. Web server send web pages and images to your.
1 CSC160 Chapter 7: Events and Event Handlers. 2 Outline Event and event handlers onClick event handler onMouseOver event handler onMouseOut event handler.
Event Handling. Objectives Using event handlers Simulating events Using event-related methods.
Project 8: Reacting to Events Essentials for Design JavaScript Level One Michael Brooks.
WDMD 170 – UW Stevens Point 1 WDMD 170 Internet Languages eLesson: Variables, Functions and Events (NON-Audio version) © Dr. David C. Gibbs WDMD.
©SoftMooreSlide 1 Introduction to HTML: Forms ©SoftMooreSlide 2 Forms Forms provide a simple mechanism for collecting user data and submitting it to.
Introduction to HTML. _______________________________________________________________________________________________________________ 2 Outline Key issues.
JavaScript Defined DOM (Document Object Model) General Syntax Body vs. Head Variables Math & Logic Selection Functions & Events Loops Animation Getting.
HTML Forms.
Copyright © Terry Felke-Morris WEB DEVELOPMENT & DESIGN FOUNDATIONS WITH HTML5 7 TH EDITION Chapter 14 Key Concepts 1 Copyright © Terry Felke-Morris.
Web Programming Overview. Introduction HTML is limited - it cannot manipulate data How Web pages are extended (include): –Java: an object-oriented programming.
JavaScript Events Java 4 Understanding Events Events add interactivity between the web page and the user You can think of an event as a trigger that.
CSC 121 Computers and Scientific Thinking Fall Event-Driven Programming.
Javascript Basic Concepts Presentation By: Er. Sunny Chanday Lecturer CSE/IT RBIENT.
JavaScript and Ajax (JavaScript Environment) Week 6 Web site:
JavaScript Events. Understanding Events Events add interactivity between the web page and the user Events add interactivity between the web page and the.
HTML Tutorial. What is HTML HTML is a markup language for describing web documents (web pages) HTML documents are described by HTML tags Each HTML tag.
Web Programming Java Script-Introduction. What is Javascript? JavaScript is a scripting language using for the Web. JavaScript is a programming language.
Ashima Wadhwa Java Script And Forms. Introduction Forms: –One of the most common Web page elements used with JavaScript –Typical forms you may encounter.
Copyright © Terry Felke-Morris Web Development & Design Foundations with HTML5 8 th Edition CHAPTER 14 KEY CONCEPTS 1 Copyright.
Event-Driven Programming
Web Development & Design Foundations with HTML5
JavaScript is a programming language designed for Web pages.
14 A Brief Look at JavaScript and jQuery.
Events Comp 205 Fall 2017.
JavaScript Basics What is JavaScript?
Presentation transcript:

Web Programming Material From Greenlaw/Hepp, In-line/On-line: Fundamentals of the Internet and the World Wide Web 1 Introduction The JavaScript Programming Language Applets The Java Programming Language Guest Books Web Page Counters Server-Side Includes

Web Programming Material From Greenlaw/Hepp, In-line/On-line: Fundamentals of the Internet and the World Wide Web 2 Introduction JavaScript and HTML Event Handlers Sample JavaScript Code The JavaScript Programming Language

Web Programming Material From Greenlaw/Hepp, In-line/On-line: Fundamentals of the Internet and the World Wide Web 3 Scripting language Not Java Statements usually embedded in HTML code Simple, interpreted programming language The JavaScript Programming Language Introduction

Web Programming Material From Greenlaw/Hepp, In-line/On-line: Fundamentals of the Internet and the World Wide Web 4 Common uses: Alert boxes Color fades Dynamic-conversion form elements Information in status line Verify form input The JavaScript Programming Language Introduction

Web Programming Material From Greenlaw/Hepp, In-line/On-line: Fundamentals of the Internet and the World Wide Web 5 JavaScript-enabled browser LANGUAGE SRC.js The JavaScript Programming Language JavaScript and HTML

Web Programming Material From Greenlaw/Hepp, In-line/On-line: Fundamentals of the Internet and the World Wide Web 6 <!- - Begin hiding for browsers that cannot process JavaScript. Include JavaScript statements here. … Last JavaScript statement goes here. End hiding script. - -> The JavaScript Programming Language JavaScript and HTML

Web Programming Material From Greenlaw/Hepp, In-line/On-line: Fundamentals of the Internet and the World Wide Web 7 JavaScript and HTML onLoad Example <!- - Begin hiding for browsers that cannot support script. function ready(){ document.forms[0].elements[0].value=“Lets go!” } //Stop hiding script. -->

Web Programming Material From Greenlaw/Hepp, In-line/On-line: Fundamentals of the Internet and the World Wide Web 8 onMouseOver and onMouseOut onMouseOver When you move mouse over item, action triggered onMouseOut When you move mouse out of area, action triggered The JavaScript Programming Language Event Handlers

Web Programming Material From Greenlaw/Hepp, In-line/On-line: Fundamentals of the Internet and the World Wide Web 9 onMouseOver and onMouseOut <A HREF = “ASSIGNMENTS/assign.html” onMouseOver = “loadimage(‘01’,’GRAPHICS/4ON.GIF’); status = ‘Assignments’; return true;” onMouseOut = “loadimage(‘01’, `GRAPHICS/4OFF.GIF’); status = ‘ ‘; return true;”> <IMG SRC = “GRAPHICS/4OFF.GIF” WIDTH = “42” HEIGHT = “42” NAME = “01” ALT = “Assignments” BORDER = “0”> The JavaScript Programming Language Event Handlers

Web Programming Material From Greenlaw/Hepp, In-line/On-line: Fundamentals of the Internet and the World Wide Web 10 The JavaScript Programming Language Event Handlers When user mouses over image: Function call made to JavaScript routine loadimage() Assignments displayed in status line return true; indicates browser can return normally from processing JavaScript

Web Programming Material From Greenlaw/Hepp, In-line/On-line: Fundamentals of the Internet and the World Wide Web 11 The JavaScript Programming Language Event Handlers onClick and Alert Box <A HREF = “killface.html” onClick = “alert(‘Thanks for loading my page:Killface.’)”> Killface’s Page

Web Programming Material From Greenlaw/Hepp, In-line/On-line: Fundamentals of the Internet and the World Wide Web 12 The JavaScript Programming Language Event Handlers

Web Programming Material From Greenlaw/Hepp, In-line/On-line: Fundamentals of the Internet and the World Wide Web 13 Event Handlers onChange and Confirm Box, Prompt Box Confirm Box function question(yourname) { var name = yourname.value var theAnswer = confirm(“Are you really “ + name + “?”) (Or: var theAnswer = prompt(“What is your name”, “”)) }

Web Programming Material From Greenlaw/Hepp, In-line/On-line: Fundamentals of the Internet and the World Wide Web 14 <FORM ACTION = METHOD = “post”> Temperature Conversion Example Using JavaScript The JavaScript Programming Language Sample JavaScript Code

Web Programming Material From Greenlaw/Hepp, In-line/On-line: Fundamentals of the Internet and the World Wide Web 15 <INPUT TYPE = “text” NAME= “cels” VALUE = “0” SIZE= “3” MAXLENGTH = “3” onChange = “fahr.value = Math.round(10 * (1.8 * this.value + 32))/10;”> ° C equals The JavaScript Programming Language Sample JavaScript Code

Web Programming Material From Greenlaw/Hepp, In-line/On-line: Fundamentals of the Internet and the World Wide Web 16 <INPUT TYPE = “text” NAME= “fahr” VALUE = “32” SIZE= “3” MAXLENGTH = “3” onChange = “cels.value = Math.round(10 * (this.value - 32)/1.8)/10;”> ° F The JavaScript Programming Language Sample JavaScript Code

Web Programming Material From Greenlaw/Hepp, In-line/On-line: Fundamentals of the Internet and the World Wide Web 17 NAME = “fahr” fahr.value Math.round() The JavaScript Programming Language Sample JavaScript Code

Web Programming Material From Greenlaw/Hepp, In-line/On-line: Fundamentals of the Internet and the World Wide Web 18 Introduction HTML Applet Tags Java-Enabled Browsers Sample Applets Applets

Web Programming Material From Greenlaw/Hepp, In-line/On-line: Fundamentals of the Internet and the World Wide Web 19 “Little application” Primary features: Information is dynamic Can respond to input Program downloaded from Web server Runs locally Applets Introduction

Web Programming Material From Greenlaw/Hepp, In-line/On-line: Fundamentals of the Internet and the World Wide Web 20 Attributes: ALIGNALT CODECODEBASE HEIGHTHSPACE NAMEVSPACE WIDTH Applets HTML Applet Tags

Web Programming Material From Greenlaw/Hepp, In-line/On-line: Fundamentals of the Internet and the World Wide Web 21 Browsers that are text-only or not Java-enabled ignore applet tags Display messages Applets Java-Enabled Browsers

Web Programming Material From Greenlaw/Hepp, In-line/On-line: Fundamentals of the Internet and the World Wide Web 22 <APPLETCODE = “HiMom.class” HEIGHT = “75” WIDTH = “125”> <PARAMNAME = “message” VALUE = “Hi Mom. How do you like my applet?”> Applets Sample Applets

Web Programming Material From Greenlaw/Hepp, In-line/On-line: Fundamentals of the Internet and the World Wide Web 23 Applets Sample Applets

Web Programming Material From Greenlaw/Hepp, In-line/On-line: Fundamentals of the Internet and the World Wide Web 24 Introduction Java and Object-Oriented Programming The Java Programming Language

Web Programming Material From Greenlaw/Hepp, In-line/On-line: Fundamentals of the Internet and the World Wide Web 25 Sun Microsystems Oak Java Virtual Machine The Java Programming Language Introduction

Web Programming Material From Greenlaw/Hepp, In-line/On-line: Fundamentals of the Internet and the World Wide Web 26 Java supports object-oriented programming (OOP) Class Subclasses: children of parent class Applet class The Java Programming Language Java and Object-Oriented Programming

Web Programming Material From Greenlaw/Hepp, In-line/On-line: Fundamentals of the Internet and the World Wide Web 27 Standard Input Fields of a Guest Book Guest Book Dynamics Mailto Guest Books Guest Books

Web Programming Material From Greenlaw/Hepp, In-line/On-line: Fundamentals of the Internet and the World Wide Web 28 address Message Name URL Guest Books Standard Input Fields of a Guest Book

Web Programming Material From Greenlaw/Hepp, In-line/On-line: Fundamentals of the Internet and the World Wide Web 29 Created using form ACTION attribute specifies name of CGI script post METHOD sends parameters During sign in and updating: Guest fills out form Submits via SUBMIT button Parameters sent to CGI script Web server runs the CGI program World writeable file Guest Books Guest Book Dynamics

Web Programming Material From Greenlaw/Hepp, In-line/On-line: Fundamentals of the Internet and the World Wide Web 30 ACTION attribute specifies a mailto hyperlink Typical guest book: Form in which user signs in Collection of previous entries CGI script processes sign-ins * manually in mailto guest books Guest Books Mailto Guest Books

Web Programming Material From Greenlaw/Hepp, In-line/On-line: Fundamentals of the Internet and the World Wide Web 31 HTML Code for a Counter Counter Usefulness Counter Display Decision Web Page Counters

Web Programming Material From Greenlaw/Hepp, In-line/On-line: Fundamentals of the Internet and the World Wide Web 32 Absolute URL for CGI script as value of SRC attribute of image tag Parameters passed using get METHOD Web Page Counters HTML Code for a Counter <IMG SRC =“ counter?data=ellen.dat&style=1” ALIGN = “absmiddle” ALT = “counter” HEIGHT = “20” WIDTH = “70”>

Web Programming Material From Greenlaw/Hepp, In-line/On-line: Fundamentals of the Internet and the World Wide Web 33 Number of hits per page Advertising rates Web Page Counters Counter Usefulness Some users offended by counters Counter Display Decision

Web Programming Material From Greenlaw/Hepp, In-line/On-line: Fundamentals of the Internet and the World Wide Web 34 Common Inclusions Utilization Server-Side Includes

Web Programming Material From Greenlaw/Hepp, In-line/On-line: Fundamentals of the Internet and the World Wide Web 35 Sends command to Web server from inside HTML document Another HTML document inside current one Counter Current time and date Last-modified date Random quote Random page Server-Side Includes Common Inclusions

Web Programming Material From Greenlaw/Hepp, In-line/On-line: Fundamentals of the Internet and the World Wide Web 36 Syntax to run a program: Syntax to insert HTML document Server-Side Includes Utilization