WEB SYSTEMS & TECHNOLOGY. Java Script  JavaScript created by Netscape  It is also client side programming  It can be use for client side checks.

Slides:



Advertisements
Similar presentations
JavaScript and the DOM Les Carr COMP3001 Les Carr COMP3001.
Advertisements

 2001 Prentice Hall, Inc. All rights reserved. 1 Chapter 7 - JavaScript: Introduction to Scripting Outline 7.1 Introduction 7.2 Simple Program: Printing.
Page 1 of 26 Javascript/Jscript Ch 7,8,9,10 Vadim Parizher Computer Science Department California State University, Northridge Spring 2003 Slides from.
Georgia Institute of Technology JavaScript part 2 Barb Ericson Georgia Institute of Technology May 2006.
Java review and more. Class Header  Public class Welcome  Case sensitive  Body of the class must be enclosed by braces.
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.
 2008 Pearson Education, Inc. All rights reserved JavaScript: Introduction to Scripting.
20-Jun-15 JavaScript and HTML Simple Event Handling.
Introduction to Web Site Development Steven Emory Department of Computer Science California State University, Los Angeles Lecture 8: JavaScript I.
Introduction to scripting
HTML Forms/Events (Instructor Lesson) The Event model HTML Forms Custom Events 1.
Introduction to JavaScript. JavaScript Facts A scripting language - not compiled but interpreted line by line at run-time. Platform independent. It is.
Scripting Languages.
 2003 Prentice Hall, Inc. All rights reserved. CHAPTER 3 JavaScript 1.
CSC318 – DYNAMIC WEB APPLICATION DEVELOPMENT
Event Handlers CS101 Introduction to Computing. Learning Goals Learn about event handlers Determine how events are useful in JavaScript Discover where.
JavaScript – part II. The if Statement if (condition) { block of code to be executed if the condition is true }
 2001 Prentice Hall, Inc. All rights reserved. 1 Chapter 7 - JavaScript: Introduction to Scripting Outline 7.1 Introduction 7.2 Simple Program: Printing.
Objective Static vs. Dynamic Web pages. Variables. Assignments. JavaScript Hierarchy of Objects JavaScript Functions (prompt(“”,””) Document.write(“”)
 2008 Pearson Education, Inc. All rights reserved JavaScript: Introduction to Scripting.
 2003 Prentice Hall, Inc. All rights reserved. CHAPTER 3 JavaScript 1.
Client-Side Scripting JavaScript.  produced by Netscape for use within HTML Web pages.  built into all the major modern browsers. properties  lightweight,
Ch 6: JavaScript Introduction to scripting part 2.
JavaScript - A Web Script Language Fred Durao
Copyright ©2005  Department of Computer & Information Science Introducing Dialogue Windows.
JS Basics 1 Lecture JavaScript - Basics. JS Basics 2 What is JavaScript JavaScript is a “simple”, interpreted, programming language with elementary object-
Dr. Qusai Abuein1 Internet & WWW How to program Chap.(6) JavaScript:Introduction to Scripting.
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 - Basic Concepts Prepared and Presented by Hienvinh Nguyen, Afshin Tiraie.
1 JavaScript: Control Structures. 2 Control Structures Flowcharting JavaScript’s sequence structure.
1 JavaScript 2 JavaScript. 2 Rollovers Most web page developers first use JavaScript for rollovers A rollover is a change in the appearance of an element.
JavaScript Making Web pages come alive. Objectives Be able to read JavaScript scripts Be able to write JavaScript scripts.
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.
 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
JavaScript. JavaScript is a programming language used to make web pages interactive. JavaScript is scripting language used for client side scripting.
1 Chapter 3 – JavaScript Outline Introduction Flowcharts Control Structures if Selection Structure if/else Selection Structure while Repetition Structure.
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.
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.
Event Handling. Objectives Using event handlers Simulating events Using event-related methods.
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.
Adapted from  2004 Prentice Hall, Inc. All rights reserved. 5 th and 4 th ed: Chapters 6,7,8 SY306 Web and Databases for Cyber Operations SlideSet #6:
JavaScript Events.
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.
Chapter 4 Java Script - Part1. 2 Outlines Introduction to Java Script Variables, Operators and Functions Conditional statements JavaScript Objects Forms.
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.
INTERNET APPLICATIONS CPIT405 JavaScript Instructor: Rasha AlOmari
 2001 Prentice Hall, Inc. All rights reserved. Outline 1 JavaScript.
JavaScript and HTML Simple Event Handling 11-May-18.
JavaScript (JS) Basics
Chapter 13 - JavaScript/JScript: Introduction to Scripting
WEB APPLICATION PROGRAMMING
JavaScript and HTML Simple Event Handling 19-Sep-18.
Chapter 7 - JavaScript: Introduction to Scripting
JavaScript: Introduction to Scripting
WEB PROGRAMMING JavaScript.
Events Comp 205 Fall 2017.
Chapter 7 - JavaScript: Introduction to Scripting
JavaScript: Introduction to Scripting
Chapter 7 - JavaScript: Introduction to Scripting
Chapter 7 - JavaScript: Introduction to Scripting
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.
Chapter 7 - JavaScript: Introduction to Scripting
Presentation transcript:

WEB SYSTEMS & TECHNOLOGY

Java Script  JavaScript created by Netscape  It is also client side programming  It can be use for client side checks

script Name of web page...script goes here </head...page body here: text, forms, tables...more JavaScript if needed...onload, onclick, etc. commands here

Writeln   Welcome to JavaScript   document.writeln( " Welcome to ",  "JavaScript Programming! " ); 

Write   Using document.write   document.write ( " Welcome to ");  document.writeln( "JavaScript Programming! " ); 

window.alert   Using window.alert   window.alert( "Welcome to\nJavaScript\nProgramming!" );   Click Refresh (or Reload) to run this script again. 

alert(), confirm(), and prompt() alert("This is an Alert method"); confirm("Are you OK?"); prompt("What is your name?"); prompt("How old are you?","20");

alert() and confirm()  Display a message in a dialog box.  The dialog box will block the browser. alert("Text to be displayed");  Display a message in a dialog box with two buttons: "OK" or "Cancel".  confirm() returns true if the user click "OK". Otherwise it returns false. var answer = confirm("Are you sure?");

prompt()  Display a message and allow the user to enter a value  The second argument is the "default value" to be displayed in the input textfield.  Without the default value, "undefined" is shown in the input textfield.  If the user click the "OK" button, prompt() returns the value in the input textfield as a string.  If the user click the "Cancel" button, prompt() returns null. prompt("What is your student id number?"); prompt("What is your name?”, "No name");

10 User input/output var firstNumber, // first string entered by user secondNumber, // second string entered by user number1, // first number to add number2, // second number to add sum; // sum of number1 and number2 // read in first number from user as a string firstNumber = window.prompt("Enter first integer", "0" ); // read in second number from user as a string secondNumber = window.prompt( "Enter second integer", "0" ); // convert numbers from strings to integers firstNumber = parseInt(firstNumber); secondNumber = parseInt( secondNumber ); // add the numbers sum = firstNumber + secondNumber; // display the results document.writeln( " The sum is " + sum + " " );

  Untitled Document   function warnUser() {  confirm("Are you a student?");  }   <!--  If onClick event handler returns false, the link  is not followed.  -->  Students access only 

Events  onclick="myfun()"  onblur="myfun()"  ondblclick=“myfun()”  onfocus="myfun()"  onkeydown="myfun()“  onkeypress="myfun()“  onmouseout="myfun()“  onmouseover="myfun()"

Events   Java Script:  function myfun()  {  var tf = document.getElementById('i1');  tf.value=“New";  }

INE2720 – Web Application Software Development All copyrights reserved by C.C. Cheung User Events, Form Example Simple JavaScript Button <!-- function dontClick() { alert("I told you not to click!"); } // --> Simple JavaScript Button <input type=“button" value="Don't Click Me" onClick="dontClick()">

Onmousedown/onmouseup   Click the text! The mouseDown() function is triggered when the mouse button is pressed down over this paragraph, and sets the color of the text to red. The mouseUp() function is triggered when the mouse button is released, and sets the color of the text to green.   function mouseDown() {  document.getElementById("myP").style.color = "red";  }  function mouseUp() {  document.getElementById("myP").style.color = "green";  } 

Over/out   The function bigImg() is triggered when the user moves the mouse pointer over the image.  The function normalImg() is triggered when the mouse pointer is moved out of the image.   function bigImg(x) {  x.style.height = "64px";  x.style.width = "64px";  }  function normalImg(x) {  x.style.height = "32px";  x.style.width = "32px";  } 

onfocus   Enter your name:  When the input field gets focus, a function is triggered which changes the background- color.   function myFunction(x) {  x.style.background = "yellow";  } 

onkeydown   A function is triggered when the user is pressing a key in the input field.   function myFunction() {  alert("You pressed a key inside the input field");  } 

onkeypress   A function is triggered when the user is pressing a key in the input field.   function myFunction() {  alert("You pressed a key inside the input field");  } 

 Thanks