Home arrow JavaScript arrow Page 2 - The Window Phase of Chrys`s Approach to ACP
JAVASCRIPT

The Window Phase of Chrys`s Approach to ACP


The Window Phase of Chrys’s Approach to ACP is similar to the Document Phase. However, instead of having HTML documents (pages) opened within one browser window, you open both browser windows. This is the ninth part of a twelve-part series on Active Client Pages.

Author Info:
By: Chrysanthus Forcha
Rating: 5 stars5 stars5 stars5 stars5 stars / 1
August 28, 2009
TABLE OF CONTENTS:
  1. · The Window Phase of Chrys`s Approach to ACP
  2. · Examples of Window Properties and Methods
  3. · Window name Property
  4. · Examples of Window Methods

print this article
SEARCH DEVARTICLES

TOOLS YOU CAN USE

advertisement
The Window Phase of Chrys`s Approach to ACP - Examples of Window Properties and Methods
(Page 2 of 4 )

In this section we look at examples of the window properties and methods above. Note that the word "window" refers to the current window.

Remember that JavaScript in the BODY element is executed as the page (having the script) opens (is loading), while script that is in the HEAD element is not executed as the page opens. The functions in the script in the HEAD element have to be called by events (e.g clicking a button). You can try all the following examples.

Examples of Window Properties

Window closed Property

Definition and Usage

The closed property returns a Boolean value that specifies whether the window has been closed.

Syntax

window.closed

Example

The following example checks whether the new window has been closed:


<html>

<head>

<script type="text/javascript">

function ifClosed()

{

document.write("'myWindow' has been closed!")

}function ifNotClosed()

{

document.write("'myWindow' has not been closed!")

}function checkWin()

{

if (myWindow.closed)

ifClosed()

else

ifNotClosed()

}

</script>

</head>

<body><script type="text/javascript">

myWindow=window.open('','','width=200,height=100')

myWindow.document.write("This is 'myWindow'")

</script><input type="button" value="Has 'myWindow' been closed?"

onclick="checkWin()"></body>

</html>


Window defaultStatus Property

Definition and Usage

The defaultStatus property sets or returns the default text in the status bar of the window. The text will be displayed when the page loads.

Syntax

window.defaultStatus=sometext

Example

The following example sets the default text in the status bar:


<html>

<body><script type="text/javascript">

window.defaultStatus="This is the default text in the status bar!!"

</script><p>Look at the text in the statusbar.</p></body>

</html>



blog comments powered by Disqus
JAVASCRIPT ARTICLES

- More Top jQuery Tutorials for Beginners
- More Top jQuery Plugins for Menus
- Top jQuery Tutorials for Beginners
- New UI Framework and SDK for JavaScript Rele...
- JavaScript OpenPGP Tool, Node.js 0.6.3 Avail...
- Yahoo Releases Cocktails Language and Develo...
- Customizing jQuery Slideshows: Dynamic Contr...
- Customizing jQuery Slideshows: the animate()...
- Customizing jQuery Slideshows: slideUp() and...
- Customizing jQuery Slideshows: hide() and sh...
- Web Workers: Performing Calculations in Para...
- More Top JavaScript Frameworks and Libraries
- More Dynamic jQuery Styling Techniques
- The Top JavaScript Libraries
- The Top JavaScript Frameworks

Dev Articles Forums 
 RSS  Articles
 RSS  Forums
 RSS  All Feeds
Weekly Newsletter
 
Developer Updates  
Free Website Content 
Contact Us 
Site Map 
Privacy Policy 
Support 



© 2003-2012 by Developer Shed. All rights reserved. DS Cluster 3 - Follow our Sitemap
Popular Web Development Topics
All Web Development Tutorials