More JavaScript.

Slides:



Advertisements
Similar presentations
Chapter 7 JavaScript: Introduction to Scripting. Outline Simple Programs Objects and Variables Obtaining User Input with prompt Dialogs – –Dynamic Welcome.
Advertisements

Georgia Institute of Technology JavaScript part 2 Barb Ericson Georgia Institute of Technology May 2006.
JavaScript (Part 2) CS 183 4/13/2010. JavaScript (Part 2) Will cover: ◦ For.. In ◦ Events ◦ Try.. Catch, Throw ◦ Objects.
HTML Comprehensive Concepts and Techniques Second Edition Project 8 Integrating JavaScript with HTML.
Web Basics ISYS546. Basic Tools Web server –Default directory, default home page –Virtual directory Web page editor –Front Page Web page languages –HTML,
Information Technology Center Hany Abdelwahab Computer Specialist.
CIS101 Introduction to Computing Week 12 Spring 2004.
1 COMM 1213 H1 COMP 4923 X1 JavaScript 2 (Readings: Ch. 12, 13, 14 Knuckles)
Generations of Programming Languages First generation  Machine Language Second Generation  Assembly Language Third Generation  Procedural language such.
JavaScript Part 1.
1 CSC160 Chapter 9: The Document Object. Outline Document objects Properties of the document object linkColor alinkColor vlinkColor bgColor fgColor lastModified.
LESSON 4 Formatting a Worksheet. Borders are often used to separate different groups of data. 1. True 2. False
Objective Static vs. Dynamic Web pages. Variables. Assignments. JavaScript Hierarchy of Objects JavaScript Functions (prompt(“”,””) Document.write(“”)
Scripting Language A scripting language or script language is a programming language that supports the writing of scripts. The term script is typically.
Using Client-Side Scripts to Enhance Web Applications 1.
XP Tutorial 6 New Perspectives on JavaScript, Comprehensive1 Working with Windows and Frames Enhancing a Web Site with Interactive Windows.
JavaScript - A Web Script Language Fred Durao
Copyright ©2005  Department of Computer & Information Science Introducing Dialogue Windows.
JavaScript Adding active content to websites. Goals Understand structure of JavaScript Understand rules of coding Add active content to WebPages Add functions.
Document Objects Forms, Images and Links. The document object model Each element of an HTML document, such as an image, form, link, or button, can be.
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.
Introduction to JavaScript Objects, Properties, Methods.
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
© 2007 D. J. ForemanJS-1 A Light Introduction for Non-programmers JavaScript for Beginners.
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.
Basic HTML Programming Technology Education Ellsworth Community Middle School Communication Systems.
HTML DOM Basharat Mahmood, Department of Computer Science, CIIT, Islamabad, Pakistan 1.
JavaScript Object Model. Biggest Advantage of JavaScript  I can access values of HTML elements using JavaScript  I can modify values of HTML elements.
Working with the Window Object JavaScript considers the browser window an object, which it calls the window object.
HTML-I Basic HTML Elements. HTML (Hyper Text Markup Language) HTML is a document layout and hyperlink- specification language. i.e. a language used to.
Javascript Basic Concepts Presentation By: Er. Sunny Chanday Lecturer CSE/IT RBIENT.
JavaScript 101 Lesson 6: Introduction to Functions.
CNIT 133 Interactive Web Pags – JavaScript and AJAX Popup Boxes.
WEB SYSTEMS & TECHNOLOGY. Java Script  JavaScript created by Netscape  It is also client side programming  It can be use for client side checks.
COM621: Advanced Interactive Web Development Lecture 6 – JavaScript (cont.)
COM621: Advanced Interactive Web Development Lecture 5 – JavaScript.
1 The Document Object Model. 2 Objectives You will be able to: Describe the structure of the W3C Document Object Model, or DOM. Use JavaScript to access.
Programming With JavaScript
CIIT-Human Computer Interaction-CSC456-Fall-2015-Mr
Pertemuan 7 JavaScript.
“Under the hood”: Angry Birds Maze
JavaScript is a programming language designed for Web pages.
JavaScript (JS) Basics
CS 330 Class 5 Programming plan for today: Questions on homework
Programming the Web using XHTML and JavaScript
Donna J. Kain, Clarkson University
WEB APPLICATION PROGRAMMING
JavaScript for Beginners
CHAPTER 4 CLIENT SIDE SCRIPTING PART 2 OF 3
14 A Brief Look at JavaScript and jQuery.
BY: SITI NURBAYA ISMAIL FACULTY of COMPUTER and MATHEMATICAL SCIENCES
DHTML.
Predefined Dialog Boxes
Javascript الجافا سكربت هي لغة برمجه اذا جاز التعبیر تلعب دور حیوي وفعال في صفحات الویب من خلال القیام بوظائف قد تكون خارجیة او داخلیة بل لنكن اكثر دقة.
Javascript Game Assessment
Conditionally Confirming a Submit
برمجة صفحات إنترنت (JavaScript )
JavaScript What is JavaScript? What can JavaScript do?
CS105 Introduction to Computer Concepts
JavaScript What is JavaScript? What can JavaScript do?
JavaScript Basics What is JavaScript?
JavaScript is a scripting language designed for Web pages by Netscape.
Web Programming– UFCFB Lecture 13
JavaScript for Beginners
JavaScript for Beginners
Barb Ericson Georgia Institute of Technology May 2006
CS105 Introduction to Computer Concepts JavaScript
JavaScript: BOM and DOM CS Programming Languages for Web Applications
Presentation transcript:

More JavaScript

Objective Hierarchy of Objects document.bgColor document.fgColor document.linkColor document.vlinkColor window.open() window.close() window.location confirm() window.moveBy()

Hierarchy of Objects Objects follow a strict hierarchy where the window object is the very top level. Such as: window.alert() Because window is the top level object it can be omitted. alert(); The second level of object is window.document such as: document.write(), document.bgcolor, etc..

Cont.. document Window alert() Prompt() Confirm() . bgColor, fgColor, linkColor vlinkColor

document.bgColor and document.fgColor document.bgColor is for changing the background color of page document.fgColor is for changing the font color of page Example <html><head>< title> background and font color</title></head> <body><p> This can be annoying... <script type=“text/javascript language="javascript"> document.bgColor=“red”; document.fgColor=“blue”; </script> </p> </body> </html>

document.linkColor and document.vlinkColor document.linkColor is for changing the color of unvisited hyper links document.vlinkColor is for changing the color of visited links Example <html><head><title> link color</title></head> <body><p> This can be annoying... <script type=“text/javascript language="javascript"> document.linkColor=“red”; document.vlinkColor=“blue”; </script> </p></body></html>

window.open() and window.close() window.open() is for opening anew window window.close() is for closing a window example <html><head><title> open and close window</title></head> <body><p> <script type=“text/javascript language="javascript"> window.open(“www.google.com); window.close(); </script> </p></body></html>

window.location window.location is for changing the location of a window example html><head></head> <body> <p> Look at the location on top! <script language="javascript"> newpage=prompt("Enter a URL“,"http://www.yahoo.com");  window.location=newpage; </script> </center> </body> </html>

Confirm() Confirm() is a method that produce dialog boxes when called It is used to get user confirmation from a dialog box containing an OK button that returns true to the script and a cancel button that returns false to the script

Cont.. ask= confirm(“do you want to open a new window?”); If (ask){ window.open(); } Else{ Alert(“you chose to not open a new window”);

window.moveBy() window.moveBy() is for moving a window either horizontally, vertically, or both, by the specified amount in pixels <html> <head> </head> <body> <p> Did the page just move? <script language="javascript"> answer = confirm("Are you ready?"); if (answer) { window.moveBy(100,100); } </script> </p> </body> </html>