Catching Events. Bok, Jong Soon

Similar documents
JavaScript and Events

CSE 154 LECTURE 10: MORE EVENTS

Events: another simple example

Forms, Form Events, and Validation. Bok, Jong Soon

Hell is other browsers - Sartre. The touch events. Peter-Paul Koch (ppk) WebExpo, 24 September 2010

Pearson Education Limited Edinburgh Gate Harlow Essex CM20 2JE England and Associated Companies throughout the world

JavaScript Handling Events Page 1

Hell is other browsers - Sartre. The touch events. Peter-Paul Koch (ppk) DIBI, 28 April 2010

Web Programming Step by Step

JavaScript and XHTML. Prof. D. Krupesha, PESIT, Bangalore

EECS1012. Net-centric Introduction to Computing. Lecture JavaScript Events

CSI 3140 WWW Structures, Techniques and Standards. Browsers and the DOM

Touch Forward. Bill Fisher. #touchfwd. Developing Awesome Cross-Browser Touch

Document Object Model (DOM) Level 3 Events

Document Object Model (DOM) Level 2 Events

Overview. Event Handling. Introduction. Reviewing the load Event. Event mousemove and the event Object. Rollovers with mouseover and mouseout

of numbers, converting into strings, of objects creating, sorting, scrolling images using, sorting, elements of object

Bok, Jong Soon

729G26 Interaction Programming. Lecture 4

COMP519 Web Programming Lecture 16: JavaScript (Part 7) Handouts

Produced by. App Development & Modeling. BSc in Applied Computing. Eamonn de Leastar

JavaScript: Events, the DOM Tree, jquery and Timing

DATABASE AUTOMATION USING VBA (ADVANCED MICROSOFT ACCESS, X405.6)

JSF. JSF and Ajax Basics

CITS3403 Agile Web Development Semester 1, 2018

JavaScript: More Syntax and Using Events

Web Design. Lecture 6. Instructor : Cristina Mîndruță Site : Cristina Mindruta - Web Design

Photo from DOM

Document Object Model (DOM) Level 3 Events

Ajax in Practice by Dave Crane Bear Bibeault Jord Sonneveld with Ted Goddard, Chris Gray, Ram Venkataraman and Joe Walker

JavaScript: Events, DOM and Attaching Handlers

Interacting with Measurement Studio Graphs in Visual Basic Heather Edwards

Information Design. Professor Danne Woo! infodesign.dannewoo.com! ARTS 269 Fall 2018 Friday 10:00PM 1:50PM I-Building 212

j I 8 EVENTS INTERACTI O NS EVENTS TRI GGER CODE RESPONDS CREATE EV ENTS CODE TO USERS

Fundamentals of Website Development

Index. Ray Nicholus 2016 R. Nicholus, Beyond jquery, DOI /

CS193X: Web Programming Fundamentals

Introduction to DHTML

New Perspectives on Creating Web Pages with HTML. Tutorial Objectives

8/19/2018. Web Development & Design Foundations with HTML5. Learning Objectives (1 of 2) Learning Objectives (2 of 2) What is JavaScript?

B. V. Patel Institute of Business Management, Computer and Information Technology, UTU. B. C. A (3 rd Semester) Teaching Schedule

INDEX. Symbols. Eloquent JavaScript 2011 by Marijn Haverbeke

JAVASCRIPT AND JQUERY: AN INTRODUCTION (WEB PROGRAMMING, X452.1)

CST242 Windows Forms with C# Page 1

Chapter 14. Dynamic HTML: Event Model

HTML5 and CSS3 The jquery Library Page 1

Cracked IntegralUI Studio for Web all pc software ]

Lecture 3: The Basics of JavaScript. Background. Needs for Programming Capability. Origin of JavaScript. Using Client-side JavaScript

jquery Basics jquery is a library of JavaScript functions which contains the following functions: HTML Element Selections

Events. Mendel Rosenblum. CS142 Lecture Notes - Events

I'm Remy. Who uses jquery.

Yahoo User Interface 2.X Cookbook

Cookies and Other Client-Side Storage Techniques. Bok, Jong Soon

Chapter 9 Introducing JQuery

5/19/2015. Objectives. JavaScript, Sixth Edition. Using Touch Events and Pointer Events. Creating a Drag-and Drop Application with Mouse Events

Skyway Builder Web Control Guide

1. Cascading Style Sheet and JavaScript

Hell is other browsers - Sartre. Ajax Workshop. Peter-Paul Koch (ppk) Fundamentos del Web, 28 October 2008

KNOCKOUTJS - EVENT BINDING

Shared Variables. Firmware v Version 1.0, 16 Apr 2013

skb2 Shaon Barman, Sarah Chasins, Ras Bodik UC Berkeley Sumit Gulwani Microsoft Research

Programming the Web VALIDATING FORM INPUT

COPYRIGHTED MATERIAL INDEX SYMBOLS


Interactor Tree. Edith Law & Mike Terry

JAVASCRIPT BASICS. Handling Events In JavaScript. In programing, event-driven programming could be a programming

Browser Guide for PeopleSoft

Developing for touch. Peter-Paul Koch Mobilism, 16 and 17 May 2013

SEEM4570 System Design and Implementation Lecture 04 jquery

2D1640 Grafik och Interaktionsprogrammering VT Good for working with different kinds of media (images, video clips, sounds, etc.

CHAPTER 6 JAVASCRIPT PART 1

ENGR/CS 101 CS Session Lecture 4

HCDE 530: Computational Techniques for HCDE Data Visualization in Web, Part 2

University of Technology Laser & Optoelectronics Engineering Department Visual basic Lab. LostFocus Resize System event

title shown on page tab <meta attribute="value"... /> page metadata (h1 for largest to h6 for smallest) emphasis (italic) strong emphasis (bold)

VectorDraw web Library

Javascript Events. Web Authoring and Design. Benjamin Kenwright

CSC Web Programming. JavaScript Browser Objects

Introduction to Programming the Google Maps API

5. Strict mode use strict ; 6. Statement without semicolon, with semicolon 7. Keywords 8. Variables var keyword and global scope variable 9.

Creating Web Pages with HTML-Level III Tutorials HTML 6.01

SA Power Networks - street light fault reporting help

Creating Content with iad JS

Co-Browsing Dynamic Web Pages

Mugshot: Recording and Replaying JavaScript Applica9ons. James Mickens

ADDING FUNCTIONS TO WEBSITE

PowerTerm WebConnect WebView

DOM Primer Part 2. Contents

INLEDANDE WEBBPROGRAMMERING MED JAVASCRIPT INTRODUCTION TO WEB PROGRAMING USING JAVASCRIPT

UNIT 3 SECTION 1 Answer the following questions Q.1: What is an editor? editor editor Q.2: What do you understand by a web browser?

shift from the page Bill Scott Yahoo! Ajax Evangelist


Outline. Lecture 4: Document Object Model (DOM) What is DOM Traversal and Modification Events and Event Handling

Instructions for downloading paid media from BSO.org and playing paid media in the BSO Media Center Revised as of 12/23/2011

MODELING AND REASONING

CERTIFICATE IN WEB PROGRAMMING

GUI Event Handling 11. GUI Event Handling. Objectives. What is an Event? Hierarchical Model (JDK1.0) Delegation Model (JDK1.1)

Web Site Development with HTML/JavaScrip

MICROSOFT EXCEL TUTORIAL HANDOUT

COPYRIGHTED MATERIAL. Index SYMBOLS

Transcription:

Catching Events Bok, Jong Soon Jongsoon.bok@gmail.com www.javaexpert.co.kr

What Is an Event? Events Describe what happened. Event sources The generator of an event Event handlers A function that receives an event, deciphers it, and processes the user s interaction.

The Events Event Description Affected Objects abort blur, focus When the image is prevented from loading When an object loses or receives focus An image element Applicable to window and form elements change When a selection changes Applicable to form elements where the value changes and after the elements loses focus click,doubleclick (dblclick) contextmenu Clicking or double-clicking(two clicks in rapid succession) with the mouse Clicking with the right mouse button(bringing up the context menu) Most page elements A web page document

The Events (Cont.) Event Description Affected Objects error keydown, keyup, keypress load, unload mousedown, mouseup mouseover, mouseout When the page or image can t load Pressing a key or releasing it, and the act of doing both When the image or page if finished loading, or the page loses focus Pressing down on the mouse button, releasing the mouse button Moving the mouse over an element, moving the mouse away from an element A web page document and image A web page document and certain form elements A web page document and image(load only) Most page elements Most page elements

The Events (Cont.) Event Description Affected Objects mousemove The mouse moves Most page elements reset A form is reset The form resize A window or frame is resized A window or frame select Selecting text A form text area or input scroll When an object is scrolled A window, frame, or element with overflow set to auto(presence of the scrollbar) submit A form is submitted A form

Event Handling To reiterate, an event handler has the following syntax: onload Where the event handler starts with on, followed by the event type : load, click, and so forth. You can implement the JavaScript to process directly in the handler: <body onload="var i = 23; i *= 3; alert(i);"> More frequently, though, you'd call a function: <body onload="calcnumber();"> window.onload=calcnumber;

Attributes Property Description altkey button clientx clienty screenx screeny shiftkey Returns whether or not the "ALT" key was pressed when an event was triggered Returns which mouse button was clicked when an event was triggered Returns the horizontal coordinate of the mouse pointer when an event was triggered Returns the vertical coordinate of the mouse pointer when an event was triggered Returns the horizontal coordinate of the mouse pointer when an event was triggered Returns the vertical coordinate of the mouse pointer when an event was triggered Returns whether or not the "SHIFT" key was pressed when an event was triggered

Sample codes

Sample codes (Cont.)

Sample codes (Cont.)

Sample codes (Cont.)

Register Event Object MSIE

Register Event Object (Cont.) Firefox, Chrome, Opera, Safari

Register Event Object (Cont.) Cross-Browser Event Handling

Event Bubbling 한개의 Event 가여러개의 Element 에영향을미칠때는어떻게?

DOM Level 2 Event Handling addeventlistener object.addeventlistener( event, eventfunction, boolean); true : bubble-up false : cascade

DOM Level 2 Event Handling (Cont.)

DOM Level 2 Event Handling (Cont.) removeeventlistener object.addeventlistener( event, eventfunction, boolean); document.forms[0].elements[0].r emoveeventlistener("click",casc adedown,true);

DOM Level 2 Event Handling (Cont.)

DOM Level 2 Event Handling (Cont.) But MSIE 6 belower, MSIE 7, MSIE 8 it's unlikely that a Microsoft product will support the W3C event model anytime soon. attachevent, detachevent object.attachevent( eventhandler, function);

DOM Level 2 Event Handling (Cont.) Cross-Browser Event Handling

DOM Level 2 Event Handling (Cont.)