Modern JavaScript Develop And Design Instructor’s Notes Chapter 2- JavaScript in Action Modern JavaScript Design And Develop Copyright © 2012 by Larry.

Slides:



Advertisements
Similar presentations
CHAPTER 3 MORE ON FORM HANDLING INCLUDING MULTIPLE FILES WRITING FUNCTIONS.
Advertisements

JavaScript and the DOM Les Carr COMP3001 Les Carr COMP3001.
HTML 5 and CSS 3, Illustrated Complete Unit L: Programming Web Pages with JavaScript.
Ch3: Introduction to HTML5 part 2 Dr. Abdullah Almutairi ISC 340 Fall 2014.
© Anselm SpoerriInfo + Web Tech Course Information Technologies Info + Web Tech Course Anselm Spoerri PhD (MIT) Rutgers University
CHAPTER 30 THE HTML 5 FORMS PROCESSING. LEARNING OBJECTIVES What the three form elements are How to use the HTML 5 tag to specify a list of words’ form.
Chapter 2 Introduction to HTML5 Internet & World Wide Web How to Program, 5/e Copyright © Pearson, Inc All Rights Reserved.
Forms, Validation Week 7 INFM 603. Announcements Try placing today’s example in htdocs (XAMPP). This will allow you to execute examples that rely on PHP.
Form Handling, Validation and Functions. Form Handling Forms are a graphical user interfaces (GUIs) that enables the interaction between users and servers.
Lesson 8 Creating Forms with JavaScript
CST JavaScript Validating Form Data with JavaScript.
Web Programming Material From Greenlaw/Hepp, In-line/On-line: Fundamentals of the Internet and the World Wide Web 1 Introduction The JavaScript Programming.
Internet & World Wide Web How to Program, 5/e Copyright © Pearson, Inc All Rights Reserved.
HTML 5 New Standardization of HTML. I NTRODUCTION HTML5 is The New HTML Standard, New Elements New Attributes Full CSS3 Support Video and Audio 2D/3D.
M. Taimoor Khan * Java Server Pages (JSP) is a server-side programming technology that enables the creation of dynamic,
_______________________________________________________________________________________________________________ E-Commerce: Fundamentals and Applications1.
Copyright 2007, Information Builders. Slide 1 Maintain & JavaScript: Two Great Tools that Work Great Together Mark Derwin and Mark Rawls Information Builders.
JavaScript and The Document Object Model MMIS 656 Web Design Technologies Acknowledgements: 1.Notes from David Shrader, NSU GSCIS 2.Some material adapted.
JavaScript Teppo Räisänen LIIKE/OAMK HTML, CSS, JavaScript HTML defines the structure CSS defines the layout JavaScript is used for scripting It.
Chapter 3 Using Validation Controls. What is a Validation Control? A control that validates the value in another control Renders as an HTML tag with an.
Web engineering. Topic: DHTML Presented by: Shah Rukh Presented to: Sir Ahsan raza.
Chapter 5 Java Script And Forms JavaScript, Third Edition.
Chapter 6: Forms JavaScript - Introductory. Previewing the Product Registration Form.
CSCI 6962: Server-side Design and Programming Introduction to AJAX.
ULI101 – XHTML Basics (Part II) What is Markup Language? XHTML vs. HTML General XHTML Rules Block Level XHTML Tags XHTML Validation.
© 2004 – 2014 Web Site Optimizers, LLC 1 HTML5 Forms Make Life Easy For Your Mobile Users Tom Bowen President Web Site
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.
© 2000 – All Rights Reserved - Page 1 Introduction to JavaScript Programming Part Two.
CHAP 3. FORM API.  Forms should still be encapsulated in a element where the basic submission attributes are set.  Forms still send the values of the.
JavaScript: Functions © by Pearson Education, Inc. All Rights Reserved.
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.
Lecture # 6 Forms, Widgets and Event Handling. Today Questions: From notes/reading/life? Share Personal Web Page (if not too personal) 1.Introduce: How.
CSC 551: Web Programming Fall 2001 emerging & alternate Web technologies  Dynamic HTML  ActiveX  XML course overview  online review sheet  advice.
Using Client-Side Scripts to Enhance Web Applications 1.
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.
NMD202 Web Scripting Week3. What we will cover today Includes Exercises PHP Forms Exercises Server side validation Exercises.
XHTML1 Images N100 Building a Simple Web Page. XHTML2 The Element The src attribute specifies the filename of an image file To include the src attribute.
Modern JavaScript Develop And Design Instructor’s Notes Chapter 1 - (Re) Introducing JavaScript Modern JavaScript Design And Develop Copyright © 2012 by.
ITCS373: Internet Technology Lecture 5: More HTML.
JavaScript - A Web Script Language Fred Durao
Introduction to Client-Side Web Development Introduction to Client-Side programming using JavaScript JavaScript; application examples 10 th February 2005.
Lecture 9: AJAX, Javascript review..  AJAX  Synchronous vs. asynchronous browsing.  Refreshing only “part of a page” from a URL.  Frameworks: Prototype,
Lecture 10 JavaScript: DOM and Dynamic HTML Boriana Koleva Room: C54
Lecture: Web Design Assis. Prof. Freshta Hanif Ehsan Faculty of Computer Science Kabul Polytechnic University Spring Semester
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.
Event JavaScript's interaction with HTML is handled through events that occur when the user or browser manipulates a page. When the page loads, that is.
Chapter 2: Variables, Functions, Objects, and Events JavaScript - Introductory.
By Tharith Sriv. To write a web page you use: HHTML (HyperText Markup Language), AASP (Active Server Page), PPHP (HyperText Preprocessor), JJavaScript,
BlackBerry Applications using Microsoft Visual Studio and Database Handling.
1 CSC160 Chapter 7: Events and Event Handlers. 2 Outline Event and event handlers onClick event handler onMouseOver event handler onMouseOut event handler.
Introduction to HTML. _______________________________________________________________________________________________________________ 2 Outline Key issues.
8 Chapter Eight Server-side Scripts. 8 Chapter Objectives Create dynamic Web pages that retrieve and display database data using Active Server Pages Process.
HTML5 Forms Forms are used to capture user input …
ASSIGNMENT POINTS DUE DATE: Monday NOV 30 JAVASCRIPT, INPUT VALIDATION, REGEX See 2 nd slide for Form See 3 rd next slide for the required features.
Modern JavaScript Develop And Design Instructor’s Notes Chapter 8 – Event Handling Modern JavaScript Design And Develop Copyright © 2012 by Larry Ullman.
PHP (cont.). 2 Functions Definition – function name(arguments){... } –syntax name as for a variable, but without $ arguments as for variables –to return.
1 CSC160 Chapter 1: Introduction to JavaScript Chapter 2: Placing JavaScript in an HTML File.
Javascript Basic Concepts Presentation By: Er. Sunny Chanday Lecturer CSE/IT RBIENT.
Beginning ASP.NET in C# and VB Chapter 9
JavaScript and Ajax (JavaScript Environment) Week 6 Web site:
INTERNET APPLICATIONS CPIT405 Forms, Internal links, meta tags, search engine friendly websites.
Tutorial 6 Creating a Web Form
HTML And the Internet. HTML and the Internet ► HTML: HyperText Markup Language  Language in which all pages on the web are written  Not Really a Programming.
JavaScript, Sixth Edition
© 2016 Pearson Education, Inc., Hoboken, NJ. All rights reserved.
JavaScript Event Handling.
IS333: MULTI-TIER APPLICATION DEVELOPMENT
Modern JavaScript Develop And Design
Presentation transcript:

Modern JavaScript Develop And Design Instructor’s Notes Chapter 2- JavaScript in Action Modern JavaScript Design And Develop Copyright © 2012 by Larry Ullman

Objectives Explain what a DOCTYPE is and why it matters to Web pages Identify the two browser operating modes Write the HTML5 DOCTYPE Create an HTML5 template Use the new HTML5 form elements and attributes

More Objectives Embed JavaScript in HTML Understand how to properly write file paths Define and demonstrate key JavaScript development approaches Learn the basics of event handling Retrieve a reference to a page element

Even More Objectives Recognize when the browser window is ready for dynamic behavior Define a simple user function. Perform basic validation of an HTML form

Document Type Declaration Should be the first line of an HTML page Tells the browser what kind of HTML to expect, and therefore what kind of features to support Impacts how the page looks and behaves Provides instruction to validators

Older DOCTYPEs HTML (2.0, 3.2, 4.01) XHTML (1.0, 1.1) Strict, Transitional, Frameset

Browser Modes Browser modes are dictated by the DOCTYPE Two modes: Standards and Quirks Invalid DOCTYPEs and improper HTML can trigger Quirks mode

HTML5 DOCTYPE Short, easy to type Supported by all major browsers Automatically triggers Standards mode Allows you to begin using HTML5 features

HTML5 The next logical HTML standard Not yet standardized Lots of new useful features, especially in forms Many features are usable today

HTML5 Template HTML5 Template

New HTML5 Input Types number range search tel url

New HTML5 Form Attributes autofocus placeholder required maxlength on textareas novalidate (on entire form)

Adding JavaScript to HTML // Actual JavaScript code goes here.

Understanding Paths Absolute Start at a fixed location, such as the Web root directory Normally begin with or just /. The same absolute path is correct regardless of where the including file is. Relative Start at the current location (i.e., the current file’s location). Begin with a file name, a folder name, or a period. A relative path is only correct for files with the same relative positions.

Paths Example Including script.js from page.html /js/script.js s/script.js js/script.js./js/script.js

Development Approaches Graceful degradation Progressive enhancement Unobtrusive JavaScript

Graceful Degradation HTML5 Template You must have JavaScript enabled!

Progressive Enhancement

Object Detection if (/* some object is defined */) { // Use that object! }

Unobtrusive JavaScript Easier to read and maintain Can be progressively enhanced Does not require JavaScript to be enabled

Obtrusive JavaScript A Link

A Basic Example Start with the HTML Establish baseline functionality Add a JavaScript layer, unobtrusively Add enhanced functionality, when supported

An HTML Form Login Address Password

Baseline Functionality By default, the form gets submitted to a server-side script. That functionality works on any device that can load an HTML form.

The JavaScript Layer Hijack the form submission. Validate the form data. If valid, allow the submission to go through to the server. If invalid, display errors.

Handling Events Event handler = call this function when this event occurs on this element. In JavaScript code: element.onevent = function window.onload = init; loginForm.onsubmit = validateForm;

Referencing Elements var = document.getElementById(' '); var password = document.getElementById('password'); var loginForm = document.getElementById('loginForm');

Defining a Function function functionName() { // Function code. } function init() { var loginForm = document.getElementById('loginForm'); loginForm.onsubmit = validateForm; } // End of init() function.

Strict Mode function init() { ‘use strict’; var loginForm = document.getElementById('loginForm'); loginForm.onsubmit = validateForm; } // End of init() function.

Simple Validation if ( ( .value.length > 0) && (password.value.length > 0) ) { return true; } else { alert('Please complete the form!'); return false; }