Javascript| Create | Tutorials Create pop-up windows with JavaScript
OK, let's go ahead and start our first tutorial. The purpose of creating a pop-up window with JavaScript is to actually open another browser window. You can set some of the properties of this browser window, such as height, width, and whether you want the window to have a status bar or a tool bar. In the following example, I set the window to: 350
X 400, which has a height of 350 pixels and a width of 400 pixels, includes other settings, such as scrollbars, and other settings (such as status bar, menu bar) are set to No (NO).
Here is the specific code that you can put in front of the page:
<script LANGUAGE = "JavaScript" >
function CreateWindow ()
{
Msgwindow=window.open ("pop_win.html", "Displaywindow"),
"Toolbar=no,width=350,height=400,directories=no,
Status=no,scrollbars=yes,resize=no,menubar=no ")
}
</SCRIPT>
A careful understanding of this piece of code, in fact, only use a window.open function, is not very simple! You might ask: How do you call this code? In fact, you need not worry, the following will be given immediately:
<form><input TYPE = "button" VALUE = "Create Window"
OnClick = "CreateWindow ()" ></FORM>