How to make a Javascript Pop-up Window by Creating and Pressing a Button
4/03/998 - Improvement for refocusing the window on step 4 (just cut and paste
the whole step)
3/22/1998
In order to have a pop up window appear when you press a button like this:
You need to do the steps below.
Steps:
| 1. In your frontpage editor, position the cursor to where you want to insert the button. |
| 2. Click on the HTML tab on the lower left corner. This will show you your web page in text mode. |
3. At the cursor (or the position where you want to put the button)
paste the text below:<form> You can change the button text by changing the value of "Instruction Page" to something else such as "Hints on Using this Page". Note that the name "pop_up()" is used below as the name of the function. See Point 7 below for more on this. |
4. Next locate the </head> tag near the top of your web page
(still in HTML text mode). Then paste this text below just before the </head>
tags.<script language="javascript"> Note: There are NO SPACES in the "http:..." line or inside the window.open(...) line. Just in case you missed that, please... NOTE: There must be NO SPACES WITHIN THE "http://..." or within the window.open(dictURL....); |
| 5. The next step is to change some of the values to suit your
needs. Most of the changes you need to do are in the text you pasted in step 4.
Change the theURL value to the address of the page you want to display in the pop-up window. Next change "Instruction" to whatever that you want. This text will be
displayed at the top bar of your pop-up window. It apparently cannot contain any
blanks. Set the width and height to reasonable values for this pop-up. It should not cover more than half the screen, as a general rule. You can assume that the viewable area of a screen is at least 620 wide and 400 high. Set resizable to yes if you want the user to be able to change the size of the window. Set scrollbars to yes if the text is bigger than the size of the window - i.e. if it has more lines than the window will show. Once you do that you can save your work and preview it. |
| 6. Once you preview it you can modify the width and height to suit your needs. The other values such as location, menubar etc., can have either yes or no as their values. You can experiment with them to see what effects they will cause. |
7. Making Multiple Buttons on a Page: You can repeat steps 3 - 5 to
create and include additional buttons on a single page. Keep the following in mind:
|
That's all....