CS 330 Class 5 Programming plan for today: Questions on homework

Slides:



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

Essentials for Design JavaScript Level One Michael Brooks
Sue Wills July Objects The JavaScript language is completely centered around objects, and because of this, it is known as an Object Oriented Programming.
JavaScript FaaDoOEngineers.com FaaDoOEngineers.com.
A really fairly simple guide to: mobile browser-based application development (part 1) Chris Greenhalgh G54UBI / Chris Greenhalgh
The Web Warrior Guide to Web Design Technologies
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.
JavaScript, Third Edition
Web Programming Material From Greenlaw/Hepp, In-line/On-line: Fundamentals of the Internet and the World Wide Web 1 Introduction The JavaScript Programming.
Javascript and the Web Whys and Hows of Javascript.
4.1 JavaScript Introduction
Chapter 6: Forms JavaScript - Introductory. Previewing the Product Registration Form.
Event Handlers CS101 Introduction to Computing. Learning Goals Learn about event handlers Determine how events are useful in JavaScript Discover where.
WEEK 3 AND 4 USING CLIENT-SIDE SCRIPTS TO ENHANCE WEB APPLICATIONS.
CNIT 133 Interactive Web Pags – JavaScript and AJAX JavaScript Environment.
JavaScript 1. What is JavaScript? JavaScript allows web authors to create dynamic pages that react to user interaction. It is an Object-based because.
1 JavaScript. 2 What’s wrong with JavaScript? A very powerful language, yet –Often hated –Browser inconsistencies –Misunderstood –Developers find it painful.
UFCEWT-20-3 Advanced Topics in Web Development Lecture 4 : JavaScript, Browsers & the HTML DOM-API.
DHTML: Dynamic HTML Internet Technology1. What is DHTML? A collection of enhancements to HTML ► To create dynamic and interactive websites Combination.
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.
Using Client-Side Scripts to Enhance Web Applications 1.
Copyright 2007, Information Builders. Slide 1 Understanding Basic HTML Amanda Regan Technical Director June, 2008.
Chapter 5: Windows and Frames
XP Tutorial 6 New Perspectives on JavaScript, Comprehensive1 Working with Windows and Frames Enhancing a Web Site with Interactive Windows.
JavaScript - A Web Script Language Fred Durao
JS Basics 1 Lecture JavaScript - Basics. JS Basics 2 What is JavaScript JavaScript is a “simple”, interpreted, programming language with elementary object-
Using an HTML image (img) element’s onclick event to change the source (src) of an iframe to an embedded youtube video.
Lecture 10 JavaScript: DOM and Dynamic HTML Boriana Koleva Room: C54
Chapter 2: Variables, Functions, Objects, and Events JavaScript - Introductory.
Dialog boxes in JavaScript Events in JavaScript – What are they – “Which events are there?” – “How do I register event handlers to an HTML element?” –
1 CSC160 Chapter 7: Events and Event Handlers. 2 Outline Event and event handlers onClick event handler onMouseOver event handler onMouseOut event handler.
HTML Overview Part 5 – JavaScript 1. Scripts 2  Scripts are used to add dynamic content to a web page.  Scripts consist of a list of commands that execute.
WDMD 170 – UW Stevens Point 1 WDMD 170 Internet Languages eLesson: Variables, Functions and Events (NON-Audio version) © Dr. David C. Gibbs WDMD.
Adding Javascript How to include javascript in a webpage.
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.
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.
XHTML Forms.
Week-12 (Lecture-1) Cascading Style Sheets (CSS): describe how documents are presented on screens. Types of Style Sheets: External Style Sheet - Define.
Introduction to.
Module 1 Introduction to JavaScript
Web Basics: HTML/CSS/JavaScript What are they?
JavaScript and HTML Simple Event Handling 11-May-18.
Applied Component I Unit II Introduction of java-script
Using DHTML to Enhance Web Pages
CIIT-Human Computer Interaction-CSC456-Fall-2015-Mr
Using JavaScript to Show an Alert
Web Development & Design Foundations with HTML5
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
JAVASCRIPTS AND HTML DOCUMENTS
JavaScript and HTML Simple Event Handling 19-Sep-18.
Introduction to JavaScript
CT Web Development, Colorado State University
DHTML Javascript Internet Technology.
Predefined Dialog Boxes
Events Comp 205 Fall 2017.
DHTML Javascript Internet Technology.
Tutorial 6 Creating Dynamic Pages
The Web Wizard’s Guide To JavaScript
Introduction to JavaScript
Introduction to Programming and JavaScript
JavaScript and Ajax (JavaScript Events)
JavaScript.
CNIT 133 Interactive Web Pags – JavaScript and AJAX
Barb Ericson Georgia Institute of Technology May 2006
JavaScript and HTML Simple Event Handling 26-Aug-19.
JavaScript and HTML Simple Event Handling 4-Oct-19.
Presentation transcript:

CS 330 Class 5 Programming plan for today: Questions on homework Closer focus on client-side JavaScript the hierarchy of objects embedding JavaScript in HTML dialogs status line timeouts and intervals Reading gets a little further from where you are comfortable. Some sections are to slog through and return to later. Concepts important and appear in different contexts. Object-oriented aspects do not look a lot like C++ Similarities with VB.

JavaScript Objects Idea: hierarchy of objects (p. 210) referred to as subsidiary to the window object document (the contents of the window) forms[ ] elements[ ] e.g. document.form[0].element[0]* anchors[ ] links[ ] ... frames[ ] history location … * or, document.simpleForm.Number1 in add.htm Script tags: just IIE Style sheets: not standard enough. Will do in HTML

JavaScript Objects (cont.) window: the highest level object. Subsidiary objects: document, frames[], history, location, ... document: an HTML document that is displayed in the window. One of its properties: window.document.lastModified (or document.lastModified) Example: a page with three frames window.frame[0] window.frame[1] window.frame[2] See forms.htm 1 2

EmbeddingJavaScript in HTML Between <script> and </script> (fact.htm) From an external file (fact2.htm) <script src= “scripts/fact.js”> </script> In an event handler onClick= “alert(‘you win the car’). Omit 12.2.3.1, event handlers in <script> tags In a URL javascript:alert(‘hello’) Omit 12.2.5, in a style sheet Script tags: just IIE Style sheets: not standard enough. Will do in HTML

JavaScript Execution Scripts executed as browser parses a document. NetscapeView/Page Source shows the result of the parse, which may differ from what was sent. E.g. source for bottom of CS330.htm: <script language="JavaScript"> document.write('Last updated: ',document.lastModified,', CCS') </script> Pages are parsed in order and must not refer to as yet undefined objects document.form[0].element[0].value = ‘hello’ in the header not OK because form[0] has not been defined. defining a function is OK Lengthy scripts can slow down a page loading Script tags: just IIE Style sheets: not standard enough. Will do in HTML

Windows and Frames (Ch. 13) The details. Window: the top-level object Properties: p. 229 Methods: p. 230 More detail beginning on p. 704 It can be confusing to distinguish between the window and the document that is a property and the contents of the window. Often the name of the window object is omitted: window.document.lastModfied = document.lastModfied Script tags: just IIE Style sheets: not standard enough. Will do in HTML

Dialogs (13.2) Windows methods that use pop-up boxes alert confirm displays a message until user confirms (OK) confirm expects confirmation (OK) or not (cancel) example: select from versions of a page [onLoad=“if confirm(‘Do you want a text… p. 233 prompt variableName = prompt(‘displayed message’) the text entered is assigned to variableName

Timeouts and intervals (13.4) Status line (13.3) Windows properties for controlling the status line msg. So far: Mouse over a hypertext link displays the URL User controlled: Page contains a status command window.status = “message” (or status = “message”) defaultStatus property can also be set Example: status.htm Timeouts and intervals (13.4) Code timed to execute at a specific time or intervals. Often it is initiated when the page is loaded via an attribute in <body> or triggered by another event and executed at subsequent intervals. Example 13-2, p 236 (clock.htm). Look at cs 330 page and mouse over mailto, internal links, external links