Home arrow JavaScript arrow Page 4 - 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 Methods
(Page 4 of 4 )

Window blur() Method

Definition and Usage

The blur() method removes focus from the current window.

Syntax

window.blur()

Example

The following example assures that the new window does NOT get focus:


<html>

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

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

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

myWindow.blur()

</script></body>

</html>


Window focus() Method

Definition and Usage

The focus() method sets focus to the current window.

Syntax

window.focus()

Example

The following example assures that the new window gets focus:


<html>

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

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

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

myWindow.focus()

</script></body>

</html>


Window open() Method

Definition and Usage

The open() method is used to open a new browser window. An example was given above; I will not repeat it here.

Window close() Method

Definition and Usage

The close() method is used to close the current window.

Syntax

window.close()

Example

The following example closes the new window:


<html>

<head>

<script type="text/javascript">

function closeWin()

{

myWindow.close()

}

</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="Close 'myWindow'"

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

</html>


Let us stop here and continue in the next part of the series.


DISCLAIMER: The content provided in this article is not warranted or guaranteed by Developer Shed, Inc. The content provided is intended for entertainment and/or educational purposes in order to introduce to the reader key ideas, concepts, and/or product reviews. As such it is incumbent upon the reader to employ real-world tactics for security and implementation of best practices. We are not liable for any negative consequences that may result from implementing any information covered in our articles or tutorials. If this is a hardware review, it is not recommended to open and/or modify your hardware.

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 11 - Follow our Sitemap
Popular Web Development Topics
All Web Development Tutorials