Home arrow HTML arrow Setting the Features of Web Page Dialog Boxes
HTML

Setting the Features of Web Page Dialog Boxes


In this second part of a five-part series on producing web page dialog boxes, you'll learn how to set the text in the status bar of a window, control the size and position of a dialog box, and more. We'll also touch on the content of the dialog box, and how to make it carry out specific tasks when it closes.

Author Info:
By: Chrysanthus Forcha
Rating: 5 stars5 stars5 stars5 stars5 stars / 1
January 05, 2009
TABLE OF CONTENTS:
  1. · Setting the Features of Web Page Dialog Boxes
  2. · Size and Position
  3. · Sending Content to the Dialog Box
  4. · Giving it Body Elements

print this article
SEARCH DEVARTICLES

Setting the Features of Web Page Dialog Boxes
(Page 1 of 4 )

Setting the Text in the Status Bar of a Window

Here I want to show you how to set the text in the status bar of the dialog box. The status bar can only take a string. If the window of the following code is opened, a dialog box (window) will be open immediately after because of the onload event. The status bar will display the phrase, “This is text for the status bar.”


<html>

<head>

<script type="text/javascript">

function openWindow()

{

myWindow = window.open("","","menubar=no,toolbar=no,status=yes","");

myWindow.status = "This is text for the status bar.";

}

</script>

</head>

<body onload="openWindow()">

<!-- the body elements of the main window go here -->

</body>

</html>


The statement window.open() returns a reference to the new window (dialog box) it has opened. If you need this reference, you can assign an identifier to it as follows:


myWindow = window.open();


Here the word "window" (without quotes in the code) is the object of the current window (web page), while myWindow is the reference of the newly opened window, returned by the statement “window.open().”

If you do not need the reference, simply do not assign it to an identifier, as follows:


window.open()


Do not forget that the open() method takes arguments.

To have text in the newly opened window, type the following into the parent window:


myWindow.status = "This is text for the status bar.";


Here, status is an attribute, which takes a string as a value. The above statement is typed in the parent window to take effect in the child (opened) window. The equivalent statement to be typed into the child window is:


window.status = "This is text for the status bar.";


Remember, that window is the object of the current web page (which has the statement).

As I said in the previous part, for simplicity, we shall not use the status bar in this series.


blog comments powered by Disqus
HTML ARTICLES

- Does HTML5 Need a Main Element?
- Revisiting the HTML5 vs. Native Debate
- HTML5: Not for Phone Apps?
- HTML5 or Native?
- Job Hunting? Freelancer.com Lists This Quart...
- HTML5 in the News
- Report: HTML5 Mobile Performance Lags
- The Top HTML5 Audio Players
- Top HTML5 Video Tutorials
- HTML5: Reasons to Learn and Use It
- More of the Top Tutorials for HTML5 Forms
- MobileAppWizard Releases HTML5 App Builder
- HTML5 Boilerplate: Working with jQuery and M...
- HTML5 Boilerplate Introduction
- New API Platform for HTML5

Watch our Tech Videos 
Dev Articles Forums 
 RSS  Articles
 RSS  Forums
 RSS  All Feeds
Write For Us 
Weekly Newsletter
 
Developer Updates  
Free Website Content 
Contact Us 
Site Map 
Privacy Policy 
Support 

Developer Shed Affiliates

 




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