| window.open('location.html','Windowname','attributes'); or
| WindowName = open('location.html','','attributes');
how to create dynamic pop-up ?
Once you already popped a new window you can fill it with an HTML page written "on the fly", in the original file.
This is achieved using famous document.write("statement") code.
Let's say you have a form that the user will fill out. When it is finished, you want the input data displayed in a new page to be printed.
This involves two processes:
| The opener page This is the page with the form on it. It contains all the codes that are needed to produce the
| The dynamic page This page only exists in the virtual world while the browser is running. It cannot be saved but it can be printed.
| |
run this example
show the source
Let's go through the source, one bit at a time... scroll the source code as you step through...
| This <BODY> code includes the form where the user is asked to fill out the form.
| The inputs are collected and once the Print button is clicked, the function PopnPrint() is called.
| |
| The <SCRIPT> is kept in the <HEAD> section of the HTML file.
| The moveTo and resizeTo commands maximise the page.
| The PopnPrint function is created using the (){} syntax.
| PopOne is to be opened in the new window
| Once PopOne exists, the dynamic (secondary) page is written on it by the line
PopOne.document.write("something");
| something can be anything, HTML tags,codes, texts, froms, etc,... even javascript!
Note that they must be in the double quotation signs when required (as text on source).
| Pay attention to how the input data are retrieved.
With <SELECT> and RADIO and CHECKBOX, you must use loops to count and find the chosen values.
| | | | | | |
For a cool mad popping window galore see The Five Window Show
more faq
MORE TO COME IN NEXT UPDATE
javascript - basic stuffs
| |