Copyright ©2005  Department of Computer & Information Science Introducing Dialogue Windows.

Slides:



Advertisements
Similar presentations
Introduction to Macromedia Director 8.5 – Lingo
Advertisements

 2001 Prentice Hall, Inc. All rights reserved. 1 Chapter 7 - JavaScript: Introduction to Scripting Outline 7.1 Introduction 7.2 Simple Program: Printing.
The Web Warrior Guide to Web Design Technologies
Georgia Institute of Technology JavaScript part 2 Barb Ericson Georgia Institute of Technology May 2006.
Outline IS400: Development of Business Applications on the Internet Fall 2004 Instructor: Dr. Boris Jukic JavaScript: Introduction to Scripting.
Computer Science 1620 Loops.
1 Outline 13.1Introduction 13.2A Simple Program: Printing a Line of Text in a Web Page 13.3Another JavaScript Program: Adding Integers 13.4Memory Concepts.
Introduction to Web Site Development Steven Emory Department of Computer Science California State University, Los Angeles Lecture 8: JavaScript I.
Visual Basic Fundamental Concepts. Integrated Development Enviroment Generates startup form for new project on which to place controls. Features toolbox.
 2004 Prentice Hall, Inc. All rights reserved. Chapter 7 - JavaScript: Introduction to Scripting Outline 7.1 Introduction 7.2 Simple Program: Printing.
WEB DESIGN AND PROGRAMMING Introduction to Javascript.
Introduction to JavaScript. JavaScript Facts A scripting language - not compiled but interpreted line by line at run-time. Platform independent. It is.
WEEK 3 AND 4 USING CLIENT-SIDE SCRIPTS TO ENHANCE WEB APPLICATIONS.
Using JavaScript in FORMs Fort Collins, CO Copyright © XTR Systems, LLC Learning to Use JavaScript in HTML FORMs Instructor: Joseph DiVerdi, Ph.D., MBA.
 2001 Prentice Hall, Inc. All rights reserved. 1 Chapter 7 - JavaScript: Introduction to Scripting Outline 7.1 Introduction 7.2 Simple Program: Printing.
Copyright ©2005  Department of Computer & Information Science Using Number & Math Objects.
Chapter 4 JavaScript and Dynamic Web pages. Objectives Static Web pages Dynamic Web pages JavaScript Variables Assignments. JavaScript Functions –(prompt(“”,””)
Objective Static vs. Dynamic Web pages. Variables. Assignments. JavaScript Hierarchy of Objects JavaScript Functions (prompt(“”,””) Document.write(“”)
Fluency with Information Technology INFO100 and CSE100 Katherine Deibel Katherine Deibel, Fluency in Information Technology1.
Using Client-Side Scripts to Enhance Web Applications 1.
Extending HTML CPSC 120 Principles of Computer Science April 9, 2012.
 2003 Prentice Hall, Inc. All rights reserved. CHAPTER 3 JavaScript 1.
Introducing JavaScript. Goals By the end of this lecture you should … Be able to describe the differences among object methods, object properties and.
Copyright ©2005  Department of Computer & Information Science JavaScript Modularity.
Dr. Qusai Abuein1 Internet & WWW How to program Chap.(6) JavaScript:Introduction to Scripting.
1 JavaScript
Input & Output Functions JavaScript is special from other languages because it can accept input and produce output on the basis of that input in the same.
JavaScript Scripting language What is Scripting ? A scripting language, script language, or extension language is a programming language.
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?” –
 2000 Deitel & Associates, Inc. All rights reserved. Outline 8.1Introduction 8.2A Simple Program: Printing a Line of Text in a Web Page 8.3Another JavaScript.
JavaScript, Fourth Edition
Conditional Statements © Copyright 2014, Fred McClurg All Rights Reserved.
1 JavaScript Part 3. Functions Allow the user to decide when a particular script should be run by the browser in stead of running as long as the page.
 2008 Pearson Education, Inc. All rights reserved JavaScript: Introduction to Scripting.
ECA 225 Applied Interactive Programming ECA 225 Applied Online Programming control structures, events, objects.
Making dynamic pages with javascript Lecture 1. Java script java versus javascript Javascript is a scripting language that will allow you to add real.
JavaScript Challenges Answers for challenges
JavaScript 1 COE 201- Computer Proficiency. Introduction JavaScript scripting language ▫Originally created by Netscape ▫Facilitates disciplined approach.
WDMD 170 – UW Stevens Point 1 WDMD 170 Internet Languages eLesson: Variables, Functions and Events (NON-Audio version) © Dr. David C. Gibbs WDMD.
 2003 Prentice Hall, Inc. All rights reserved. Chapter 7 - JavaScript: Introduction to Scripting Outline 7.1 Introduction 7.2 Simple Program: Printing.
Chapter 7 - JavaScript: Introduction to Scripting Outline 7.1 Introduction 7.2 Simple Program: Printing a Line of Text in a Web Page 7.3 Another JavaScript.
Fluency with Information Technology INFO100 and CSE100 Katherine Deibel Katherine Deibel, Fluency in Information Technology1.
HTML DOM Basharat Mahmood, Department of Computer Science, CIIT, Islamabad, Pakistan 1.
Working with the Window Object JavaScript considers the browser window an object, which it calls the window object.
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 Events. Understanding Events Events add interactivity between the web page and the user Events add interactivity between the web page and the.
CNIT 133 Interactive Web Pags – JavaScript and AJAX Popup Boxes.
1 Agenda  Unit 7: Introduction to Programming Using JavaScript T. Jumana Abu Shmais – AOU - Riyadh.
INTERNET APPLICATIONS CPIT405 JavaScript Instructor: Rasha AlOmari
WEB SYSTEMS & TECHNOLOGY. Java Script  JavaScript created by Netscape  It is also client side programming  It can be use for client side checks.
 2001 Prentice Hall, Inc. All rights reserved. Outline 1 JavaScript.
Input, Output and Variables GCSE Computer Science – Python.
CHAPTER 10 JAVA SCRIPT.
CIIT-Human Computer Interaction-CSC456-Fall-2015-Mr
WEB APPLICATION PROGRAMMING
Introduction to Scripting
CHAPTER 4 CLIENT SIDE SCRIPTING PART 2 OF 3
Chapter 7 - JavaScript: Introduction to Scripting
Predefined Dialog Boxes
JavaScript: Introduction to Scripting
WEB PROGRAMMING JavaScript.
Conditionally Confirming a Submit
T. Jumana Abu Shmais – AOU - Riyadh
We are starting JavaScript. Here are a set of examples
Web Programming Ben Blanc
Introducing JavaScript
Chapter 7 - JavaScript: Introduction to Scripting
Chapter 7 - JavaScript: Introduction to Scripting
Chapter 7 - JavaScript: Introduction to Scripting
Presentation transcript:

Copyright ©2005  Department of Computer & Information Science Introducing Dialogue Windows

Copyright ©2005  Department of Computer & Information Science Goals By the end of this lecture you should … Understand how to use basic JavaScript dialogue windows.Understand how to use basic JavaScript dialogue windows. Understand the importance of the dot operator.Understand the importance of the dot operator.

Copyright ©2005  Department of Computer & Information Science JavaScript Dialogue Windows To help us write simple scripts and also to de-bug our code, JavaScript provides three basic dialogue windows:To help us write simple scripts and also to de-bug our code, JavaScript provides three basic dialogue windows: –window.alert() –window.prompt() –window.confirm()

Copyright ©2005  Department of Computer & Information Science Quick Note on the Dot Operator Did you notice in the previous example that the window object connected to its methods using a period? The period is called a dot operator.Did you notice in the previous example that the window object connected to its methods using a period? The period is called a dot operator. We can use the dot operator to connect objects to their methods and attributes. In the previous example, we connected methods of the window object.We can use the dot operator to connect objects to their methods and attributes. In the previous example, we connected methods of the window object.

Copyright ©2005  Department of Computer & Information Science window.alert() To output text in a dialogue window, we would use the alert method of the window object: window.alert(text to show);To output text in a dialogue window, we would use the alert method of the window object: window.alert(text to show); The method takes one argument, a string value, that it will display. The value can be a literal value or a variable value.The method takes one argument, a string value, that it will display. The value can be a literal value or a variable value.

Copyright ©2005  Department of Computer & Information Science Take the next few minutes to examine the file called introToDialOper_01.html.

Copyright ©2005  Department of Computer & Information Science window.prompt() To ask the user a question and give the user a way to respond, we could use the prompt method of the window object: window.prompt(question,default);To ask the user a question and give the user a way to respond, we could use the prompt method of the window object: window.prompt(question,default); The method takes two arguments: the question to ask the user and a default answer, both string type values. We separate arguments with a comma.The method takes two arguments: the question to ask the user and a default answer, both string type values. We separate arguments with a comma.

Copyright ©2005  Department of Computer & Information Science window.prompt() We capture a user’s answer to a question posed by window.prompt() by assigning the method to a variable: strAnswer = window.prompt(…);We capture a user’s answer to a question posed by window.prompt() by assigning the method to a variable: strAnswer = window.prompt(…); The resulting value is always a string data- type.The resulting value is always a string data- type.

Copyright ©2005  Department of Computer & Information Science Take the next few minutes to examine the file called introToDialOper_02.html.

Copyright ©2005  Department of Computer & Information Science window.confirm() We can also get user input by using the confirm method of the window object: window.confirm(question);We can also get user input by using the confirm method of the window object: window.confirm(question); The method takes one arguments: the question to ask the user. Just like window.prompt(), we can assign its return value to a variable. The data type, however, is boolean, not string!The method takes one arguments: the question to ask the user. Just like window.prompt(), we can assign its return value to a variable. The data type, however, is boolean, not string!

Copyright ©2005  Department of Computer & Information Science window.confirm() When we use window.confirm(), the user will see a dialogue box with a question and two buttons: an OK button and a Cancel button.When we use window.confirm(), the user will see a dialogue box with a question and two buttons: an OK button and a Cancel button. If the user clicks OK, the return value is true.If the user clicks OK, the return value is true. If the user clicks Cancel, the return value is false.If the user clicks Cancel, the return value is false.

Copyright ©2005  Department of Computer & Information Science Take the next few minutes to examine the file called introToDialOper_03.html.

Copyright ©2005  Department of Computer & Information Science Let's try one … Develop an application that will:Develop an application that will: –Ask the user for their name –Ask the user for TWO numbers –Add those numbers –Double the sum –Output a custom message, including their name and the result (example follows): "Nathan, your answer is 12."

Copyright ©2005  Department of Computer & Information Science What are the inputs? What are the processes? What are the outputs?

Copyright ©2005  Department of Computer & Information Science Use the JavaScript template (javaScriptTemplate.html) to create your solution.

Copyright ©2005  Department of Computer & Information Science Summary We can use window.alert() to display basic output.We can use window.alert() to display basic output. We can use window.prompt() to get basic input information from a user.We can use window.prompt() to get basic input information from a user. We can use window.confirm() to limit user input to a true/false value.We can use window.confirm() to limit user input to a true/false value.