JavaScript - Part 2 - CIS 4004: Web Based Information...

Info iconThis preview shows pages 1–5. Sign up to view the full content.

View Full Document Right Arrow Icon
CIS 4004: JavaScript – Part 2 Page 1 © Dr. Mark Llewellyn CIS 4004: Web Based Information Technology Spring 2011 Introduction To JavaScript – Part 2 Department of Electrical Engineering and Computer Science University of Central Florida Instructor : Dr. Mark Llewellyn markl@cs.ucf.edu HEC 236, 407-823-2790 http://www.cs.ucf.edu/courses/cis4004/spr2011
Background image of page 1

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
CIS 4004: JavaScript – Part 2 Page 2 © Dr. Mark Llewellyn In the examples from part 1 of the JavaScript notes, the scripts were triggered automatically. In other words, the visitor didn’t need to do anything for the script to execute. These were “automatically triggered” scripts. Sometimes you do not want the script to run until the visitor does something to trigger it. For example, you might want to run a script when the visitor mouses over a particular image or link, or when a page is loaded. These actions – mousing over or loading a page – are called intrinsic events . There are currently 18 predefined intrinsic events you can use as triggers to determine when a script will run. The table on the next couple of pages list these intrinsic events and which elements they work with. Triggering A Script
Background image of page 2
CIS 4004: JavaScript – Part 2 Page 3 © Dr. Mark Llewellyn Event Works With When onblur <a>, <area>,<button>,<input>, <label>, <select>, <textarea> The visitor leaves an element that was previously in focus (see onfocus below). onchange <input>, <select>, <textarea> The visitor modifies the value or contents of the element. onclick All elements except <applet>, <base>, <basefont>, <br>, <font>, <frame>, <frameset>, <head>, <html>, <iframe>, <meta>, <param>, <script>, <style>, <title> The visitor clicks on the specified area. ondblclick Same as for onclick The visitor double clicks the specified area. onfocus <a>, <area>,<button>,<input>, <label>, <select>, <textarea> The visitor selects, clicks, or tabs to the specified element. onkeydown <input> (of type name or password), <textarea> The visitor types something in the specified element. onkeypress <input> (of type name or password), <textarea> The visitor types something in the specified element. onkeyup <input> (of type name or password), <textarea> The visitor lets go of the key after typing in the specified element. Table of Intrinsic Events
Background image of page 3

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
CIS 4004: JavaScript – Part 2 Page 4 © Dr. Mark Llewellyn Event Works With When onload <body>, <frameset> The page is loaded in the browser. onmousedown Same as for onclick The visitor presses the mouse button down over the element. onmousemove Same as for onclick The visitor moves the mouse over the specified element after having pointed at it. onmouseout Same as for onclick The visitor moves the mouse away from the specified element after having been over it. onmouseover
Background image of page 4
Image of page 5
This is the end of the preview. Sign up to access the rest of the document.

Page1 / 28

JavaScript - Part 2 - CIS 4004: Web Based Information...

This preview shows document pages 1 - 5. Sign up to view the full document.

View Full Document Right Arrow Icon
Ask a homework question - tutors are online