COS 125 DAY 20. Agenda Assignment 8 not corrected yet Assignment 9 posted  Due April 16 New course time line Discussion on Scripts 

Slides:



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

function coffeeinfo() { document.getElementById('p3').innerHTML = "The word 'coffee' was.
Computer and Communication Fundamental Basic web programming Lecture 8 Rina Zviel-Girshin.
JavaScript and the DOM Les Carr COMP3001 Les Carr COMP3001.
The Web Warrior Guide to Web Design Technologies
Georgia Institute of Technology JavaScript part 2 Barb Ericson Georgia Institute of Technology May 2006.
Multimedia and the World Wide Web HCI 201 Lecture Notes #8B.
Chapter 7 © 2001 by Addison Wesley Longman, Inc. 1 Chapter 7 Sebesta: Programming the World Wide Web.
20-Jun-15 JavaScript and HTML Simple Event Handling.
Computer Science 103 Chapter 4 Advanced JavaScript.
Lesson 2 Event Handling. Object Event Handlers Most of the objects that make up the Document Object Model respond to asynchronous, user generated events.
JavaScript Client Side scripting. Client-side Scripts Client-side scripts, which run on the user’s workstation can be used to: Validate user inputs entered.
UNIT 6 JAVASCRIPT EVENT HANDLERS &WEB BROWSERS DETECTION.
CP476 Internet Computing JavaScript and HTML1 1.JavaScript Execution Environment The JavaScript Window object represents the window in which the browser.
HTML Forms/Events (Instructor Lesson) The Event model HTML Forms Custom Events 1.
CNIT 133 Interactive Web Pags – JavaScript and AJAX Event and Event Handling.
JavaScript - a Brief Introduction Anupriya. What is JavaScript Object based (not object oriented) programming language –very limited object creation –a.
Event Handlers CS101 Introduction to Computing. Learning Goals Learn about event handlers Determine how events are useful in JavaScript Discover where.
Chapter 19: Adding JavaScript
CNIT 133 Interactive Web Pags – JavaScript and AJAX JavaScript Environment.
Internet Mark-up Languages CO32036 Part Lecture: Elementary JavaScript.
JavaScript Informatics for economists I. Introduction Programming language used in web pages. Simple and easy to use – written in HTML document. Client.
DHTML: Dynamic HTML Internet Technology1. What is DHTML? A collection of enhancements to HTML ► To create dynamic and interactive websites Combination.
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.
CO1552 Web Application Development HTML Forms, Events and an introduction to JavaScript.
Scripts Chapter Scripts Small programs used to add interactivity to your web pages The backbone of Dynamic HTML (DHTML) Most scripts are written.
Intro to JavaScript Scripting language –ECMAScript compliant –Client side vs. server side Syntactic rules –White space –Statement end: ; optional –Comments:
Lecture 10 JavaScript: DOM and Dynamic HTML Boriana Koleva Room: C54
Scott Marino MSMIS Summer Session Web Site Design and Authoring Session 8 Scott Marino.
Chapter 14: Dynamic HTML: Event Model Presented by: Colbie Brown CS340 Java Web Development Dr. Gloria Carter Love.
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.
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,
Chapter 19 Creating and Processing HTML Forms. How HTML Forms Transmit Data name1=value1&name2=value2...&nameN =valueN GET or POST GET, an HTTP GET request,
Active X – Mouse Events. Structured Graphics Control  Included in Internet Explorer v5.0  Add to page with the OBJECT tag  Accessible via scripting.
Thursday, August 6 th, 2015 Instructor: Craig Duckett Event Handling.
1 Chapter 05: Creating Your Form. What is a Form? When you visit some websites you see a form. With this form, you are asked to complete, for example,
Jaana Holvikivi 1 Introduction to Javascript Jaana Holvikivi Metropolia.
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.
 Scripts that execute in response to some event  User clicking on something  Script does NOT execute as part of page loading  DOM facilities like.
Web Programming Java Script & jQuery Web Programming.
CIS 3.5 Lecture 2.3 "Introduction to JavaScript".
5 th and 4 th ed: some from chapters 9, 12, 13 SY306 Web and Databases for Cyber Operations Slide Set #8: Dynamic HTML.
7. JavaScript Events. 2 Motto: Do you think I can listen all day to such stuff? –Lewis Carroll.
Web Programming Overview. Introduction HTML is limited - it cannot manipulate data How Web pages are extended (include): –Java: an object-oriented programming.
Document Object Model Nasrullah. DOM When a page is loaded,browser creates a Document Object Model of the Page.
JavaScript Events.
JavaScript Event Handlers. Introduction An event handler executes a segment of a code based on certain events occurring within the application, such as.
LESSON : EVENTS AND FORM VALIDATION -JAVASCRIPT. EVENTS CLICK.
Event Handlers Events are asynchronous. When an event occurs, JavaScript can execute code in response to the user’s action. This response to the user-initiated.
JavaScript and Ajax (JavaScript Environment) Week 6 Web site:
Functions Wouldn’t it be nice to be able to bring up a new animal and paragraph without having to reload the page each time? We can! We can place the.
SE-2840 Dr. Mark L. Hornick 1 Dynamic HTML Handling events from DOM objects.
Methods and Object Information. Some Document Methods.
JavaScript and HTML Simple Event Handling 11-May-18.
Server-Side Application and Data Management IT IS 3105 (Spring 2010)
JAVASCRIPTS AND HTML DOCUMENTS
JavaScript and HTML Simple Event Handling 19-Sep-18.
JavaScript Events.
DHTML Javascript Internet Technology.
DHTML Javascript Internet Technology.
CHAPTER 7 JavaScripts & HTML Documents
Web Design and Development
JavaScript and Ajax (JavaScript Events)
CNIT 133 Interactive Web Pags – JavaScript and AJAX
Week 5: Recap and Portfolio Site
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:

COS 125 DAY 20

Agenda Assignment 8 not corrected yet Assignment 9 posted  Due April 16 New course time line Discussion on Scripts 

New time line April  13 Scripts Part 1  16 Assignment 9 due Scripts part 2  20 PodCasting & RSS Progress report  23 Assignment 10 due Quiz 3  27 Capstones & Presentations Due

Adding scripts to xHTML Scripts are little program that add activity to web pages Scripts are the basis for DHTML  Covered in COS 381 Mostly all web script is done in JavaScript  Only similarity with JAVA is the name

Adding scripts Two types  Scripts that require user action  Scripts that do not require user action called automatic scripts Automatic scripts  Executed by the browser when the page is loaded  If there is more than one script they are loaded in the order they appear in the web page

Adding a script …. javascript commands ….. language is deprecated If you want the script to load before the web page loads  place the script in the head section

A simple script amples/scripts/simple.html amples/scripts/simple.html

External script You can separate the JavaScript and place it in a file (*.js) and call it from inside the xHTML page <script type=“text/javascript” language=“JavaScript” src=“script.url”> tern.html tscript.txt

User triggered scripts Scripts can be activated by user events Different elements have different events  Events onload >> Script to be run when a document load onunload >> Script to be run when a document unloads

Form events The attributes below can be used in form elements: onblur >> Script to be run when an element loses focus onchange >> Script to be run when an element change onfocus >> Script to be run when an element gets focus onreset >> Script to be run when a form is reset onselect >> Script to be run when an element is selected onsubmit >>Script to be run when a form is submitted

Mouse events Valid in all elements except base, bdo, br, frame, frameset, head, html, iframe, meta, param, script, style, and title.  onclick >> Script to be run on a mouse click  ondblclick >> Script to be run on a mouse double-click  onmousedown >> Script to be run when mouse button is pressed  onmousemove >> Script to be run when mouse pointer moves  onmouseout >> Script to be run when mouse pointer moves out of an element  onmouseover >> Script to be run when mouse pointer moves over an element  onmouseup >> Script to be run when mouse button is released

Other events Image events  onabort >> Script to be run when loading of an image is interrupted Keyboard events Valid for all elements except base, bdo, br, frame, frameset, head, html, iframe, meta, param, script, style, and title. onkeydown >> Script to be run when a key is pressed onkeypress >> Script to be run when a key is pressed and released onkeyup >> Script to be run when a key is released

Link a script to a user event In the opening tag of whatever element you wish to be associated with the script type event_type =“some script” EX. onclick=“alert(‘here is today\’s’ + Date())” s/scripts/time.html

Buttons to launch scripts You can create a Button to launch a script by associating a script with the onclick user event for the button What time is it?

Alternate Information Used for browsers that cannot (or will not) run scripts ….. xHTML code ….

Hiding Scripts from old browsers After opening script tag enclose your JavaScript with the following <! -- JavaScript code // -- >

Hiding scripts from XML parsers "+Date()+" ") ]]>

Setting a default Script language In the head sections type

More on JavaScript sp sp m m