Topic 5 Windows and Frames. 2 Goals and Objectives Goals Goals Understand JavaScript window object, how popup windows work, find the browser that a client.

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

Copyright ©2005 Department of Computer & Information Science Advanced DHTML & DOM: Working with the Window Object.
© 2011 Delmar, Cengage Learning Chapter 1 Getting Started with Dreamweaver.
JavaScript FaaDoOEngineers.com FaaDoOEngineers.com.
XP 1 Developing a Basic Web Site Tutorial 2: Web Site Structures & Links.
1 Lesson 5 Introduction to Cascading Style Sheets HTML and JavaScript BASICS, 4 th Edition Barksdale / Turner.
The Web Warrior Guide to Web Design Technologies
Project 1 Introduction to HTML.
Macromedia Dreamweaver 4 Foundation Level Course.
Chapter 16 Dynamic HTML and Animation The Web Warrior Guide to Web Design Technologies.
Javascript Document Object Model. How to use JavaScript  JavaScript can be embedded into your html pages in a couple of ways  in elements in both and.
JavaScript ICW: Lecture 11 Tom Chothia. Last Lecture URLs Threads, to make a process run in parallel: Make it extend Thread Give it a run method Call.
The Browser Object Model (BOM) The API of JavaScript’s browser host environment SE-2840 Dr. Mark L. Hornick 1.
Chapter 9 Introduction to the Document Object Model (DOM) JavaScript, Third Edition.
Announcement #1 1 Lecture 9. Announcement #2  Midterm exam will be on Oct. 12 (Tuesday)  pm – 1.45 pm  Exam will cover all materials till Oct.
1st Project Introduction to HTML.
HTML 1 Introduction to HTML. 2 Objectives Describe the Internet and its associated key terms Describe the World Wide Web and its associated key terms.
Chapter ONE Introduction to HTML.
Web Browser: Netscape Navigator and Internet Explorer By Bhupendra Ratha, Lecturer School of Library and Information Science Devi Ahilya University, Indore.
DHTML - Introduction Introduction to DHTML, the DOM, JS review.
Chapter 4 Dreamweaver: Part II The Web Warrior Guide to Web Design Technologies.
DHTML. What is DHTML?  DHTML is the combination of several built-in browser features in fourth generation browsers that enable a web page to be more.
4.1 JavaScript Introduction
XP New Perspectives on Browser and Basics Tutorial 1 1 Browser and Basics Tutorial 1.
Ku-Yaw Chang Assistant Professor, Department of Computer Science and Information Engineering Da-Yeh University.
Chapter 2 Developing a Web Page. Chapter 2 Lessons Introduction 1.Create head content and set page properties 2.Create, import, and format text 3.Add.
Unobtrusive JavaScript
Chapter 8 OBJECT-ORIENTED TECHNOLOGIES AND DSS DESIGN Decision Support Systems For Business Intelligence.
History, Navigator, Screen and Form Objects Basharat Mahmood, Department of Computer Science, CIIT, Islamabad, Pakistan 1.
CSE 154 LECTURE 19: EVENTS AND TIMERS. Anonymous functions function(parameters) { statements; } JS JavaScript allows you to declare anonymous functions.
Title, meta, link, script.  The title looks like:  The tag defines the title of the document in the browser toolbar.  It also: ◦ Provides a title for.
XP Dreamweaver 8.0 Tutorial 3 1 Adding Text and Formatting Text with CSS Styles.
Creating an Animated Web Page
XP Tutorial 4 New Perspectives on JavaScript, Comprehensive1 Working with Objects Creating an Animated Web Page.
HTML. Principle of Programming  Interface with PC 2 English Japanese Chinese Machine Code Compiler / Interpreter C++ Perl Assembler Machine Code.
JavaScript, Fourth Edition
5.2 DOM (Document Object Model). 2 Motto: To write it, it took three months; to conceive it three minutes; to collect the data in it — all my life. —F.
Introduction to JavaScript 41 Introduction to Programming the WWW I CMSC Winter 2004 Lecture 17.
DHTML - Introduction Chapter Introduction to DHTML, the DOM, JS review.
Tutorial 5 Windows and Frames Section B - Working with Frames and Other Objects Go to Other Objects.
Chapter 5: Windows and Frames
 2003 Prentice Hall, Inc. All rights reserved. Introduction to HTML: Frames Outline 1 Introduction 2 frameset Element 3 Nested frameset s 4 Web Resources.
XP Tutorial 6 New Perspectives on JavaScript, Comprehensive1 Working with Windows and Frames Enhancing a Web Site with Interactive Windows.
 2004 Prentice Hall, Inc. All rights reserved. Chapter 13 - Dynamic HTML: Object Model and Collections Outline 13.1 Introduction 13.2 Object Referencing.
Cs332a_chapt10.ppt CS332A Advanced HTML Programming DHTML Dynamic Hypertext Markup Language A term describing a series of technologies Not a stand-a-lone.
The Web Wizard’s Guide To JavaScript Chapter 8 Working with Windows and Frames.
JavaScript DOM.
Project 10: Exploring the Window Object Essentials for Design JavaScript Level One Michael Brooks.
JavaScript, Fourth Edition Chapter 4 Manipulating the Browser Object Model.
Tutorial 3 Adding and Formatting Text with CSS Styles.
TOPIC II Dynamic HTML Prepared by: Nimcan Cabd Cali.
OBJECTS What is an Object? Definition Properties Methods Events.
HTML Concepts and Techniques Fifth Edition Chapter 1 Introduction to HTML.
Project 5: Using Pop-Up Windows Essentials for Design JavaScript Level One Michael Brooks.
The Web Wizard’s Guide To DHTML and CSS Chapter 2 A Review of CSS2 and JavaScript.
JavaScript and Ajax (JavaScript Environment) Week 6 Web site:
XP New Perspectives on Macromedia Dreamweaver MX 2004 Tutorial 5 1 Adding Shared Site Elements.
20-753: Fundamentals of Web Programming 1 Lecture 13: Javascript II Fundamentals of Web Programming Lecture 13: Javascript II.
The Web Wizard’s Guide To DHTML and CSS Chapter 2 A Review of CSS2 and JavaScript.
HTML PROJECT #1 Project 1 Introduction to HTML. HTML Project 1: Introduction to HTML 2 Project Objectives 1.Describe the Internet and its associated key.
Project 1 Introduction to HTML.
Objective % Select and utilize tools to design and develop websites.
Applied Component I Unit II Introduction of java-script
Chapter 1 Introduction to HTML.
In this session, you will learn to:
Project 1 Introduction to HTML.
Client-Side Internet and Web Programming
Objective % Select and utilize tools to design and develop websites.
The Web Wizard’s Guide To JavaScript
Presentation transcript:

topic 5 Windows and Frames

2 Goals and Objectives Goals Goals Understand JavaScript window object, how popup windows work, find the browser that a client is using, how to use DHTML, and understand the relationship between frames and windows Objectives Objectives Windows and frames Windows and frames Browser object Browser object Location object Location object History object History object Window object Window object Frames Frames DHTML DHTML Practice using the window and other objects Practice using the window and other objects

3 Chapter Headlines 1 Introduction 1 Introduction Learn the secrets behind all these ad popups Learn the secrets behind all these ad popups 2 Browser Object 2 Browser Object Find out which browser a client is using Find out which browser a client is using 3 Location Object 3 Location Object Control 7 Including JavaScript files Control 7 Including JavaScript files Learn how to load and use library files Learn how to load and use library files 8 DHTML 8 DHTML Find out what the “D” in DHTML means Find out what the “D” in DHTML means

4Introduction When browsing, many other windows pop up When browsing, many other windows pop up Closing these windows gives rise to others Closing these windows gives rise to others This attracts the attention of web surfers This attracts the attention of web surfers Different browsers are often incompatible Different browsers are often incompatible Web sites optimize their web pages for a particular browser Web sites optimize their web pages for a particular browser JavaScript makes all of this easy to accomplish JavaScript makes all of this easy to accomplish JavaScript provides objects with properties and behaviors for these actions JavaScript provides objects with properties and behaviors for these actions

5 Browser Object JavaScript browser related objects are: navigator, MimeType, and Plugin JavaScript browser related objects are: navigator, MimeType, and Plugin Properties of navigator object: appCodeName, appName, appVersion, language, mimeType, platform, plugins, userAgent Properties of navigator object: appCodeName, appName, appVersion, language, mimeType, platform, plugins, userAgent Methods of navigator object: javaEnabled(), preference(), taintEnabled() Methods of navigator object: javaEnabled(), preference(), taintEnabled()

6 Browser Object Example 23.1: Use navigator object

7 Location Object Location object represents the URL associated with a window object Location object represents the URL associated with a window object Properties of Location object: hash, host, hostname, href, pathname, port, protocol, search Properties of Location object: hash, host, hostname, href, pathname, port, protocol, search Methods of Location object: reload(), replace(), Methods of Location object: reload(), replace(),

8 Location Object Example 23.2: Use Location object

9 History Object History object contains the URLs that the client has visited during a browser session History object contains the URLs that the client has visited during a browser session Properties of History object: length, current, next, previous Properties of History object: length, current, next, previous Methods of Location object: back(), forward(), go(x) Methods of Location object: back(), forward(), go(x)

10 History Object Example 23.3: Use History object

11 Window Object window object is the root object in JavaScript DOM tree window object is the root object in JavaScript DOM tree We can refer to the current window in three ways: window, self, top We can refer to the current window in three ways: window, self, top Properties of window object: closed, defaultStatus, document, frames, history, innerHeight, innerWidth, length, location, locationbar, menubar, name, opener, outerHeight, outerWidth, pageXOffset, pageYOffset, parent, personalbar, scrollbars, self, status, statusbar, toolbar, top, window Properties of window object: closed, defaultStatus, document, frames, history, innerHeight, innerWidth, length, location, locationbar, menubar, name, opener, outerHeight, outerWidth, pageXOffset, pageYOffset, parent, personalbar, scrollbars, self, status, statusbar, toolbar, top, window Methods of window object: alert(), back(), blur(x), captureEvents(), clearInterval(), clearTimeout(), close(), confirm(), find(), focus(), forward(), home, moveBy(), open(), print(), resizeBy(), etc. Methods of window object: alert(), back(), blur(x), captureEvents(), clearInterval(), clearTimeout(), close(), confirm(), find(), focus(), forward(), home, moveBy(), open(), print(), resizeBy(), etc.

12 Window Object Example 23.4: Create and ad popup window

13 Frame Object A frame set displays multiple frames each with its own URL A frame set displays multiple frames each with its own URL JavaScript does not use tree structure to simplify dealing with nesting frames JavaScript does not use tree structure to simplify dealing with nesting frames JavaScript creates an array called frames that holds all the frames of a frame set JavaScript creates an array called frames that holds all the frames of a frame set JavaScript represents a frame using a window object JavaScript represents a frame using a window object Example: frames[0].document is the first frame declared frames[1].document is the second frame declared frames[2].document is the third frame declared Example: frames[0].document is the first frame declared frames[1].document is the second frame declared frames[2].document is the third frame declared

14 Frame Object Example 23.6: Use frames

15 Including JavaScript Files JavaScript can load and use files stored in libraries JavaScript can load and use files stored in libraries Functions can be stored in their own files and can be loaded at run-time Functions can be stored in their own files and can be loaded at run-time The benefits are: The benefits are: Simplifies the HTML files of web pages Simplifies the HTML files of web pages Makes one function usable by more than one web page Makes one function usable by more than one web page Provides a central location to change a function Provides a central location to change a function The file extensions are.js example myLib.js The file extensions are.js example myLib.js These files are accessed using the src attribute of the tag These files are accessed using the src attribute of the tag One must carefully specify the path name with including such files One must carefully specify the path name with including such files

16 Including JavaScript Files Example 23.7: Use.js files

17DHTML Dynamic HTML (DHTML) has three components: Dynamic HTML (DHTML) has three components: CSS CSS Content positioning Content positioning Downloadable fonts Downloadable fonts It provides greater control over appearance, layout, and behavior It provides greater control over appearance, layout, and behavior Some people extend DHTML to include any dynamic action in a web page that is generated by JavaScript Some people extend DHTML to include any dynamic action in a web page that is generated by JavaScript Web developers can also control the visibility of web page elements via DHTML Web developers can also control the visibility of web page elements via DHTML

18Summary Popups are generated by using certain JavaSript objects Popups are generated by using certain JavaSript objects Browser object contains information about client side browser Browser object contains information about client side browser Location object represents the URL Location object represents the URL History object represents the visited URLs History object represents the visited URLs Window object is the root level object Window object is the root level object Frame object is represented using a window object Frame object is represented using a window object JavaScript enables us to use and load library files JavaScript enables us to use and load library files DHTML is a loosely defined term DHTML is a loosely defined term