JavaScript
  Home arrow JavaScript arrow Page 3 - The Window Phase of Chrys`s Approach to AC...
Dev Articles Forums 
ADO.NET  
Apache  
ASP  
ASP.NET  
C#  
C++  
ColdFusion  
COM/COM+  
Delphi-Kylix  
Design Usability  
Development Cycles  
DHTML  
Embedded Tools  
Flash  
Graphic Design  
HTML  
IIS  
Interviews  
Java  
JavaScript  
MySQL  
Oracle  
Photoshop  
PHP  
Reviews  
Ruby-on-Rails  
SQL  
SQL Server  
Style Sheets  
VB.Net  
Visual Basic  
Web Authoring  
Web Services  
Web Standards  
XML  
Mobile Linux 
App Generation ROI 
IBM® developerWorks 
Weekly Newsletter
 
Developer Updates  
Free Website Content 
 RSS  Articles
 RSS  Forums
 RSS  All Feeds
Write For Us Get Paid 
Request Media Kit
Contact Us 
Site Map 
Privacy Policy 
Support 
 USERNAME
 
 PASSWORD
 
 
  >>> SIGN UP!  
  Lost Password? 
JAVASCRIPT

The Window Phase of Chrys`s Approach to ACP
By: Chrysanthus Forcha
  • Search For More Articles!
  • Disclaimer
  • Author Terms
  • Rating: 5 stars5 stars5 stars5 stars5 stars / 1
    2009-08-28

    Table of Contents:
  • The Window Phase of Chrys`s Approach to ACP
  • Examples of Window Properties and Methods
  • Window name Property
  • Examples of Window Methods

  • Rate this Article: Poor Best 
      ADD THIS ARTICLE TO:
      Del.ici.ous Digg
      Blink Simpy
      Google Spurl
      Y! MyWeb Furl
    Email Me Similar Content When Posted
    Add Developer Shed Article Feed To Your Site
    Email Article To Friend
    Print Version Of Article
    PDF Version Of Article
     
     
    ADVERTISEMENT


    The Window Phase of Chrys`s Approach to ACP - Window name Property


    (Page 3 of 4 )

    Definition and Usage

    The name property sets or returns the name of the window.

    Syntax

    window.name=name

    Example

    The following example returns the name of the new window:


    <html>

    <head>

    <script type="text/javascript">

    function checkWin()

    {

    document.write(myWindow.name)

    }

    </script>

    </head>

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

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

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

    </script><input type="button" value="What's the name of 'myWindow'?"

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

    </html>


    Window opener Property

    Definition and Usage

    The opener property returns a reference to the window that created the window.

    Syntax

    window.opener

    Example

    The following example writes some text to the opener window (parent window):


    <html>

    <body>


    <script type="text/javascript">

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

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

    myWindow.focus()

    myWindow.opener.document.write("This is the parent window")

    </script>


    </body>

    </html>


    Window self Property

    Definition and Usage

    The self property returns a reference to the current window.

    Syntax

    window.self

    Example

    The following example checks whether or not the window is in a frame -- and if it is, it breaks out of the frame:


    <html>

    <head>

    <script type="text/javascript">

    function breakout()

    {

    if (window.top!=window.self)

    {

    window.top.location="tryjs_breakout.htm"

    }

    }

    </script>

    </head>

    <body><input type="button" onclick="breakout()"

    value="Break out of frame!"></body>

    </html>


    tryjs_breakout.htm is a file in the same directory.

    Window status Property

    Definition and Usage

    The status property sets or returns the text in the status bar of a window.

    Syntax

    window.status=sometext

    Example

    The following example sets the text in the status bar:


    <html>

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

    window.status="Some text in the status bar!!"

    </script></body>

    </html>


    More JavaScript Articles
    More By Chrysanthus Forcha


     

    JAVASCRIPT ARTICLES

    - Using jQuery to Preload Images with CSS and ...
    - Using Client-Side Scripting to Preload Image...
    - Removing Non-Semantic Markup when Preloading...
    - Using the Display CSS Property to Preload Im...
    - Preloading Images with CSS and JavaScript
    - Scaling and Moving Web Page Elements with th...
    - Fading, Hiding and Sliding HTML Elements wit...
    - Toggling CSS Properties with the GX JavaScri...
    - Cancel, Queue and Pause Animations with the ...
    - Producing Elastic Effects with the GX JavaSc...
    - Moving Divs Diagonally with the GX JavaScrip...
    - Moving Elements Vertically and Horizontally ...
    - Making Bouncing Effects in Parallel with the...
    - Creating Bouncing Effects with the GX JavaSc...
    - Manipulating Background Colors with the GX J...







    © 2003-2010 by Developer Shed. All rights reserved. DS Cluster 3 Hosted by Hostway
    For more Enterprise Application Development news, visit eWeek