The Doll Palace Home 
[Where Cartoon Dolls Live]

Manual on The Doll Palace

General
» Animated Doll
» Other Manuals on the Net
» Static Doll
Graphic Editors
» Paint
» Photoshop
Technical
» How to change the Homepage (startpage)
» How to Configure the Active Desktop
» How to enable JavaScript (JScript) in a browser.
» HTML (Javascript) Popup
» HTML Color Chart
» Icons FAQ
» SpyWare Problem
» Windows Clipboard (Copy-Paste)
The Doll Palace
» Are pop-up ads allowed on TDP?
» Becoming a Member
» Doll in Hotmail Signature
» Doll in Yahoo Signature
» Doll Maker
» Downloads
» Internet Setup Problem
» Personal Preferences
» Personal Templates
» Referral Program
» Safe Dollmaker
» Signing In
» Technical Details
HTML (Javascript) Popup
The easiest way to create a popup is using the anchor html tag (<a href="">). There are two spots in the tag that you can use for a popup, depending on the situation you have. In both cases we will use javascript window object with method open.

<a href="javascript: var a=window.open('url1','windowname','properties');">First Popup</a>

This is the simplest popup, when user clicks on a link new windo pops up with defined url1 and properties. Current window content do not change.



<a href="url1" onclick="var a=window.open('url2','windowname','properties');">Second Popup</a>

This is little beet more sophisticated, when user follows the link, he gets new popup with defined url2 and properties, but at the same time content of the current window changes to url1. If you want to have the same functionality as in the first popup, you can modify code a little:

<a href="url1" onclick="var a=window.open('url2','windowname','properties');return false;">Second Popup</a>

In this case it does not matter what url1 is, user will only get a popup with url2, content of the current user window will not be changed.

Many people ask how to create popup in the back (it become very popular nowdays), this way user is not distructed that much. We will use the same method, just will add some details for the window focusing:

<a href="javascript: var win_one=window.open('url1','windowname','properties');win_one.blur();window.focus();">Popup In the Back</a>

References:
URL - this is a string containing the URL of the document to open in the new window. If no URL is specified, an empty window will be created.

WINDOWNAME - this is a string containing the name of the new window. This can be used as the 'target' attribute of a
or tag to point to the new window.

PROPERTIES - this is an optional string that contains details of which of the standard window features are to be used with the new window. This takes the form of a comma-delimited list. Most of these features require yes or no (1 or 0 is also o.k.) and any of these can be turned on by simply listing the feature (they default to yes). Also, if you don't supply any of the feature arguments, all features with a choice of yes or no are enabled; if you do specify any feature parameters, titlebar and hotkeys still default to yes but all others are no.

Note that many of the values for the features parameter are Netscape only. Further, with the exception of dependent and hotkey, these Netscape only values represent potential sources of security problems and therefore require signed script (and user's permission) if they are to be used.

alwaysLowered (netscape) When set to yes, this creates a window that always floats below other windows.
alwaysRaised (netscape) When set to yes, this creates a window that always floats above other windows.
dependent (netscape) When set to yes, the new window is created as a child (closes when the parent window closes and does not appear on the task bar on Windows platforms) of the current window.
directories When set to yes, the new browser window has the standard directory buttons.
height This sets the height of the new window in pixels.
hotkeys (netscape) When set to no, this disables the use of hotkeys (except security and quit hotkeys) in a window without a menubar.
innerHeight (netscape) This sets the inner height of the window in pixels.
innerWidth (netscape) This sets the inner width of the window in pixels.
location When set to yes, this creates the standard Location entry feild in the new browser window.
menubar When set to yes, this creates a new browser window with the standard menu bar (File, Edit, View, etc.).
outerHeight (netscape) This sets the outer height of the new window in pixels.
outerWidth (netscape) This sets the outer width of the new window in pixels.
resizable When set to yes this allows the resizing of the new window by the user.
screenX (netscape) This allows a new window to be created at a specified number of pixels from the left side of the screen.
screenY (netscape) This allows a new window to be created at a specified number of pixels from the top of the screen.
scrollbars When set to yes the new window is created with the standard horizontal and vertical scrollbars, where needed
status When set to yes, the new window will have the standard browser status bar at the bottom.
titlebar (netscape) When set to yes the new browser window will have the standard title bar.
toolbar When set to yes the new window will have the standard browser tool bar (Back, Forward, etc.).
width This sets the width of the new window in pixels.
z-lock (netscape) When set to yes this prevents the new window from rising above other windows when it is made active (given focus).
channelmode (IE4) Sets if the window appears in channel mode.
fullscreen (IE4) The new window will appear in full screen.
left (IE4) Same as screenX, allows a new window to be created at a specified number of pixels from the left side of the screen.
top (IE4) Same as screenY, allows a new window to be created at a specified number of pixels from the top of the screen.


The following example creates a new window of the specified dimensions complete with toolbar, changes the background color and writes a message to it.

Code:
myWindow = window.open("", "tinyWindow", 'toolbar,width=150,height=100')
myWindow.document.write("Welcome to this new window!")
myWindow.document.bgColor="lightblue"
myWindow.document.close()
© 2008 The Doll Palace. All rights reserved. Terms & Conditions   Privacy Statement   Advertise   Sitemap