Scripts Chapter 19-20. Scripts Small programs used to add interactivity to your web pages The backbone of Dynamic HTML (DHTML) Most scripts are written.

Slides:



Advertisements
Similar presentations
17 HTML, Scripting, and Interactivity Section 17.1 Add an audio file using HTML Create a form using HTML Add text boxes using HTML Add radio buttons and.
Advertisements

The Web Warrior Guide to Web Design Technologies
JavaScript 101 Lesson 01: Writing Your First JavaScript.
Tutorial 6 Working with Web Forms
1 A Balanced Introduction to Computer Science, 2/E David Reed, Creighton University ©2008 Pearson Prentice Hall ISBN Chapter 7 Event-Driven.
Session 7: HTML 3 - Desain Isi J0394 – Perancangan Situs Web Program Studi Manajemen Universitas Bina Nusantara.
Introduction to JavaScript. Aim To enable you to write you first JavaScript.
4.1 JavaScript Introduction
XP Tutorial 6New Perspectives on Creating Web Pages with HTML, XHTML, and XML 1 Creating Web Page Forms Designing a Product Registration Form Tutorial.
XP Tutorial 6New Perspectives on HTML and XHTML, Comprehensive 1 Creating Web Page Forms Designing a Product Registration Form Tutorial 6.
JavaScript and The Document Object Model MMIS 656 Web Design Technologies Acknowledgements: 1.Notes from David Shrader, NSU GSCIS 2.Some material adapted.
JavaScript Teppo Räisänen LIIKE/OAMK HTML, CSS, JavaScript HTML defines the structure CSS defines the layout JavaScript is used for scripting It.
KRAD makes it easy to handle HTML events in your webpage. Kuali University: Apply Now Lab 6: Fun with HTML Events Lab Objectives HTML Events – what are.
XHTML Introductory1 Forms Chapter 7. XHTML Introductory2 Objectives In this chapter, you will: Study elements Learn about input fields Use the element.
McGraw-Hill/Irwin © 2004 by The McGraw-Hill Companies, Inc. All rights reserved. Dynamic Action with Macromedia Dreamweaver MX Barry Sosinsky Valda Hilley.
SEG3210 DHTML Tutorial. DHTML DHTML is a combination of technologies used to create dynamic and interactive Web sites. –HTML - For creating text and image.
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.
10 Adding Interactivity to a Web Site Section 10.1 Define scripting Summarize interactivity design guidelines Identify scripting languages Compare common.
DHTML: Dynamic HTML Internet Technology1. What is DHTML? A collection of enhancements to HTML ► To create dynamic and interactive websites Combination.
1 rfXcel Confidential Copyright 2007 Web Technology JavaScript 12/10/07.
SEG3210 DHTML Tutorial. DHTML DHTML is a combination of technologies used to create dynamic and interactive Web sites. –HTML - For creating text and image.
Section 17.1 Add an audio file using HTML Create a form using HTML Add text boxes using HTML Add radio buttons and check boxes using HTML Add a pull-down.
Client Side Programming with JavaScript Why use client side programming? Web sides built on CGI programs can rapidly become overly complicated to maintain,
INTRODUCTION TO JAVASCRIPT AND DOM Internet Engineering Spring 2012.
Copyright 2007, Information Builders. Slide 1 Understanding Basic HTML Amanda Regan Technical Director June, 2008.
 2008 Pearson Education, Inc. All rights reserved Introduction to XHTML.
JavaScript - A Web Script Language Fred Durao
Tutorial 6 Working with Web Forms. 2New Perspectives on HTML, XHTML, and XML, Comprehensive, 3rd Edition Objectives Explore how Web forms interact with.
Lecture 10 JavaScript: DOM and Dynamic HTML Boriana Koleva Room: C54
Introduction to JavaScript CS101 Introduction to Computing.
44238: Dynamic Web-site Development Client Side Programming Ian Perry Room:C48 Extension:7287
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.
Internet & World Wide Web How to Program, 5/e. © by Pearson Education, Inc. All Rights Reserved.
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,
JavaScript Introduction.  JavaScript is a scripting language  A scripting language is a lightweight programming language  A JavaScript can be inserted.
1 Chapter 3 – JavaScript Outline Introduction Flowcharts Control Structures if Selection Structure if/else Selection Structure while Repetition Structure.
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.
COS 125 DAY 20. Agenda Assignment 8 not corrected yet Assignment 9 posted  Due April 16 New course time line Discussion on Scripts 
Tutorial 6 Working with Web Forms. 2New Perspectives on HTML, XHTML, and XML, Comprehensive, 3rd Edition Objectives Explore how Web forms interact with.
Headings are defined with the to tags. defines the largest heading. defines the smallest heading. Note: Browsers automatically add an empty line before.
CIS 3.5 Lecture 2.3 "Introduction to JavaScript".
INTRODUCTION JavaScript can make websites more interactive, interesting, and user-friendly.
USING JAVASCRIPT TO SHOW AN ALERT Web Design Sec 6-2 Part or all of this lesson was adapted from the University of Washington’s “Web Design & Development.
Web Programming Overview. Introduction HTML is limited - it cannot manipulate data How Web pages are extended (include): –Java: an object-oriented programming.
Understanding JavaScript and Coding Essentials Lesson 8.
Document Object Model Nasrullah. DOM When a page is loaded,browser creates a Document Object Model of the Page.
JavaScript Event Handlers. Introduction An event handler executes a segment of a code based on certain events occurring within the application, such as.
Introduction 1.HTML DOM events allow JavaScript to register different event handlers on elements in an HTML document. 2.Events are normally used in combination.
Web Programming Java Script-Introduction. What is Javascript? JavaScript is a scripting language using for the Web. JavaScript is a programming language.
FORMS Explained By: Jasdeep Kaur. Lecturer, Department of Computer Application, PGG.C.G., Sector: 42, Chandigarh.
XP Tutorial 6New Perspectives on HTML, XHTML, and DHTML, Comprehensive 1 Creating Web Page Forms Designing a Product Registration Form Tutorial 6.
Section 10.1 Define scripting
Using DHTML to Enhance Web Pages
Using JavaScript to Show an Alert
Lecture Bells and Whistles.
Intro to JavaScript CS 1150 Spring 2017.
Donna J. Kain, Clarkson University
Section 17.1 Section 17.2 Add an audio file using HTML
Server-Side Application and Data Management IT IS 3105 (Spring 2010)
Section 10.1 YOU WILL LEARN TO… Define scripting
DHTML Javascript Internet Technology.
DHTML Javascript Internet Technology.
Introduction to JavaScript
Web Design and Development
Tutorial 10: Programming with javascript
Introduction to Programming and JavaScript
CNIT 133 Interactive Web Pags – JavaScript and AJAX
Presentation transcript:

Scripts Chapter 19-20

Scripts Small programs used to add interactivity to your web pages The backbone of Dynamic HTML (DHTML) Most scripts are written in JavaScript which is supported by most browsers The scripts will be inserted into the XHTML code when needed. JavaScript is actually a powerful and complex programming language. We will be learning only the basics.

Automatic Scripts Execute automatically when the page is loaded Run in the order in which they appear in the XHTML file. If the script is used in several different pages, then it can be saved in a separate file and “called” from any web page.

The script tag <script type=“text/javascript” language=“JavaScript” > The actual script itself goes here. <meta http-equiv=“content-type” Content=“text/html; charset=iso ”/> Simple Scripts document.write(“Visca Catalunya!”) Here’s the rest of the page.

The script tag <meta http-equiv=“content-type” Content=“text/html; charset=iso ”/> Accessing external scripts Here’s the rest of the page. <script type=“text/javascript” language=“JavaScript”> src=“extscript.txt”> The text file “extscript.txt” contains: document.write(“Visca Catalunya!”)

Triggered Scripts Script is executed only when intrinsic event occurs There are 18 pre-defined intrinsic events A user causes an intrinsic event to occur by performing some action (usually with the mouse) See next slide for list of intrinsic events

intrinsic events onloadthe page is loaded in the browserbody, frameset onunloadbrowser load a different page after specified page has loaded body, frameset onclickthe visitor clicks on the specified areaall elements except applet, base, basefont, br, font, frame, ondblclickthe visitor double clicks the specified areaframeset, head, html, iframe, meta, param, script, style,title onmousedownvisitor presses the mouse button down over the element same as for onclick/ondblclick onmouseupvisitor lets the mouse button go after having clicked on element same as for onclick/ondblclick onmouseovervisitor points the mouse at the elementsame as for onclick/ondblclick onmousemovevisitor moves mouse over element after pointing at it same as for onclick/ondblclick onmouseoutvisitor moves mouse away from element after being over it same as for onclick/ondblclick

onselectvisitor selects one or more chars or words in the element input(of type name or password), textarea onfocusthe visitor selects, clicks, or tabs to the specified element a, area, button, input, label, select, textarea onblurvisitor leaves an element that was previously in focus a, area, button, input, label, select, textarea onkeypressthe visitor types something in the specified element input(of type name or password), textarea onkeydownthe visitor types something in the specified element input(of type name or password), textarea onkeyupvisitor lets go of the key after typing in the specified element input(of type name or password), textarea onsubmitvisitor clicks the form’s submit buttonform (not input of type submit) onresetvisitor clicks the form’s reset buttonform (not input of type reset) onchangethe visitor modifies the value or contents of the element input, select, textarea intrinsic events (cont)

Not all browsers support scripts Use … element Llumi's big cat dreams end comments to hide scripts Your browser isn't running scripts, so you can't see what Llumi's thinking. Point at Llumi to see what she's thinking.

Hiding Scripts Older browsers –<script type=“text/javascript” <!— –littlecat=new image(143,83) –littlecat.src= “real.jpg” –bigcat = new Image(143,83) –bigcat.src = :dream.jpg” // a JavaScript comment -->

Hiding Scripts from XML Parsers <sxript<sxript <![CDATA[ document.write(“ etc … “) ]]>