Creating Web Documents: JavaScript, continued Tool reports Creating new windows Form input verification Homework: read about JavaScript, start planning.

Slides:



Advertisements
Similar presentations
MWD1001 Website Production Using JavaScript with Forms.
Advertisements

CSS The basics { }. CSS Cascading Style Sheets - language used to – describe html appearance & formatting Style Sheet - file that describes – how html.
/k/k 1212 Cascading Style Sheets Part one Marko Boon
JavaScript and the DOM Les Carr COMP3001 Les Carr COMP3001.
HTML Overview - Cascading Style Sheets (CSS). Before We Begin Make a copy of one of your HTML file you have previously created Make a copy of one of your.
Presenter: James Huang Date: Sept. 26,  Introduction  Basics  Lists  Links  Forms  CSS 2.
HTML – A Brief introduction Title of page This is my first homepage. This text is bold  The first tag in your HTML document is. This tag tells your browser.
It’s All About Style The Basics of Style Sheets Presented by Barry Diehl.
Introduction to CSS.
Cascading Style Sheets. CSS stands for Cascading Style Sheets and is a simple styling language which allows attaching style to HTML elements. CSS is a.
CSS BASICS. CSS Rules Components of a CSS Rule  Selector: Part of the rule that targets an element to be styled  Declaration: Two or more parts: a.
Cascading Style Sheets Based on Castro, HTML for the WWW, 6 th edition Ron Gerton, Fall 2007.
HCI 201 Week 6 Client Side Image Maps Introduction to CSS.
Web Workshop: CSS Objectives: - “What is CSS?” - Structure of CSS - How to use CSS in your webpage.
20-Jun-15 JavaScript and HTML Simple Event Handling.
Computer Science 103 Chapter 4 Advanced JavaScript.
JavaScript 101 Lesson 5: Introduction to Events. Lesson Topics Event driven programming Events and event handlers The onClick event handler for hyperlinks.
4.01 Cascading Style Sheets
Web Development & Design Foundations with XHTML Chapter 14 Key Concepts.
Copyright © Terry Felke-Morris WEB DEVELOPMENT & DESIGN FOUNDATIONS WITH HTML5 Chapter 14 Key Concepts 1 Copyright © Terry Felke-Morris.
JMD2144 – Lesson 5 Web Design & New Media. ‘Div’ide and conquer One of the most versatile structure tags available is the.. tag Short for ision, it allows.
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.,
HTML Concepts and Techniques Fourth Edition Project 8 Creating Style Sheets.
CNIT 133 Interactive Web Pags – JavaScript and AJAX Event and Event Handling.
Cascading Style Sheets (CSS) 1.  What is CSS?  Why CSS?  How to write a CSS? 2.
JavaScript Part 1.
Creating Web Documents XHTML Project II topics should be posted Start Forms Homework: Forms not required for midterm or project 2. At some point, read.
Copyright © Terry Felke-Morris WEB DEVELOPMENT & DESIGN FOUNDATIONS WITH HTML5 Chapter 14 Key Concepts 1 Copyright © Terry Felke-Morris.
Adding User Interactivity – Lesson 51 Adding User Interactivity Lesson 5.
 This presentation introduces the following: › 3 types of CSS › CSS syntax › CSS comments › CSS and color › The box model.
Using Cascading Style Sheet As you create more web pages, you may wish to impose a consistent look for all of your web pages or for group of related pages.
Just A Few More Fun Objectives 1 Having Some Fun With Java Script 2 Using Style Sheets.
Working with Cascading Style Sheets (CSS) Module 2: HTML Basics LESSON 5.
Using Client-Side Scripts to Enhance Web Applications 1.
JavaScript, jQuery, and Mashups Incorporating JavaScript, jQuery, and other Mashups into existing pages.
Creating Web Documents: JavaScript Continue with JavaScript Form check Dice (die) throw Questions for midterm Homework: Prepare for midterm. Complete project.
Creating Web Documents catch-up JavaScript slide show tools redirection.
Cascading Style Sheets Creating a Uniform Site. Style Sheets  Style sheets are used for conformity on a web page or web site.  Style sheets eliminate.
DYNAMIC HTML What is Dynamic HTML: HTML code that allow you to change/ specify the style of your web pages. Example: specify style sheet, object model.
XHTML Formatting font with a style declaration. Formatting Font HTML uses the font tag to change size and family of font But… the font tag is being deprecated.
1 CSC160 Chapter 7: Events and Event Handlers. 2 Outline Event and event handlers onClick event handler onMouseOver event handler onMouseOut event handler.
Web Design (12) CSS Introduction. Cascading Style Sheets - Defined CSS is the W3C standard for defining the presentation of documents written in HTML.
Event Handling. Objectives Using event handlers Simulating events Using event-related methods.
Copyright © Terry Felke-Morris WEB DEVELOPMENT & DESIGN FOUNDATIONS WITH HTML5 7 TH EDITION Chapter 14 Key Concepts 1 Copyright © Terry Felke-Morris.
Cascading Style Sheets Primary readings Presentations Explain & review projects with class mates.
Creating Web Documents: JavaScript Ftp / file management: review Introduction to JavaScript Sources Homework: start review for midterm, work on Project.
JavaScript II ECT 270 Robin Burke. Outline Functions Events and event handling Form validation.
Javascript Basic Concepts Presentation By: Er. Sunny Chanday Lecturer CSE/IT RBIENT.
JavaScript and Ajax (JavaScript Dynamic HTML (DHTML)) Week 7 Web site:
Internet & World Wide Web How to Program, 5/e Copyright © Pearson, Inc All Rights Reserved.
Basic HTML Page 1. First Open Windows Notepad to type your HTML code 2.
CSS Introductions. Objectives To take control of the appearance of a Web site by creating style sheets. To use a style sheet to give all the pages of.
Creating Web Documents CSS examples (do more later) Lab/Homework: Read chapters 15 & 16. Work on Project 3, do postings.
Objective % Select and utilize tools to design and develop websites.
JavaScript and HTML Simple Event Handling 11-May-18.
4.01 Cascading Style Sheets
Web Development & Design Foundations with HTML5
JavaScript is a programming language designed for Web pages.
Madam Hazwani binti Rahmat
Web Development & Design Foundations with HTML5 7th Edition
Objective % Select and utilize tools to design and develop websites.
JavaScript and HTML Simple Event Handling 19-Sep-18.
Cascading Style Sheets™ (CSS)
JavaScript Basics What is JavaScript?
4.01 Cascading Style Sheets
Web Programming and Design
JavaScript and HTML Simple Event Handling 26-Aug-19.
JavaScript and HTML Simple Event Handling 4-Oct-19.
Presentation transcript:

Creating Web Documents: JavaScript, continued Tool reports Creating new windows Form input verification Homework: read about JavaScript, start planning project 3.

Tool reports What did you like? When evaluating a tool: –Consider initial entry AND making changes. –Consider use on large and small projects.

Image links without borders

Document object model For JavaScript to refer to HTML document, need names for things… –Objects [new] windows HTML document –Methods (procedures that do something) –Events (event=something that happens. Your code specifies the action for ‘handling’ the event)

Image swap

Rollover test <!-- function movein(image) { window.document.picture1.src=image; } // End --> This is the start of the page.<a href="" onMouseOver="movein('Darcy3.jpg');" onClick="return false;" onMouseOut="movein('Liz-book.jpg');"> onMouseOver starts statement indicating what to do for that event. Need to give image a name Link doesn’t do anything

More on code Function movein defined in head section. onMouseOver and onMouseOut indicate two events. The statement –onMouseOver = "movein('Darcy3.jpg');" means when the MouseOver event happens, do this statement in quotes. –Note: the inner quotes around the image file name need to be single quotes or else????

Combine mouseovers & image maps <a href="" onMouseOver="movein('tvon1a.jpg');" onMouseOut="movein('tvoff.jpg');">

Verification of user data Recent example of bad interface design: –Butterfly ballot: permitted double (multiple) votes –Other ballots: no caution to voter: you did not pick a presidential candidate.

Calculation examples Go to newmedia.purchase.edu/~Jeanine –HTML/JavaScript examples –Or Explanation of code… is a word document explaining the three 3 examples that follow.

Form verification example Show in two parts: –a verify function written in the head section –the form itself, with the call to verify part of the onSubmit event handler

Form example function verify(f) { if (f.lname.value == null || f.address.value == null) { alert("Form needs a last name and an address"); return false; } if (f.lname.value == "" || f.address.value == "") { alert("Form needs a last name and an address"); return false; } return true; }

Address Information <form method=post enctype="text/plain" onSubmit="return verify(this);"> First Name: Last Name: Street Address: Town/City: State: New York New Jersey Connecticut Pennsylvania Status: Returning client New client Thank you

Creating new windows May want to create a new, small window as a result of site visitor indicating a choice in a menu. Window.open is the method that opens new windows. The parameters indicate the URL, name, and other properties such as height. selectedIndex is the property that indicates what was selected. Options is an array that refers to the different choices

JavaScript code for creating new window Will do this with three statements. First two set up (declare) variables and set their values. var sel = window.document.fx.choice.selectedIndex; var selurl = window.document.fx.choice.options[sel].value; window.open(selurl,'insert', 'HEIGHT=200,WIDTH=300,scrollbars=yes'); Note: fx and choice were my choices for names of the form and the select tag. sel and selurl were my choices for names for these variables. insert was my choice for the name of the window (not used here). Note: window, document, selectedIndex, options, value are components of the document object model for JavaScript.

Select test Application Form Selection will open up a small window with one of 4 sample html files. <select name="choice" size=1 OnChange="var sel = window.document.fx.choice.selectedIndex; var selurl = window.document.fx.choice.options[sel].value; window.open (selurl,'insert','HEIGHT=200,WIDTH=300,scrollbars=yes')"> fourth first second third

Cascading Style Sheets: preview way of specifying more elaborate formatting in uniform way: –across page / site / business (everyone uses the same external style sheet) Uneven implementation on browsers. May be replaced by XML and XSL

My First Stylesheet <!-- H1 { color: blue; font-size: 40px; font-family: times} h2 { color: red; font-size: 30px; font-family: arial} P { text-indent: 100px; background: yellow; font- family: times} p.intro {text-indent: 0px; background: blue; font- family: impact} p.side {text-indent: 500px; background:red; font- family: verdana; font-size:10px} Stylesheet Example Next level heading Amaze your friends! Squash your enemies! Intro paragraph This is an aside

Project III Include JavaScript to support some interaction with site visitor. Use of style sheets (Read in text. We will do more later.) Your choice of topic, but I must approve. You may chose to build on Project II (check with me). You may chose to work in teams. Announcement due as posting before next class. Respond to current event postings AND tools posting.