JavaScript instance Tutorial (1) Creating pop-up windows

Source: Internet
Author: User
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>



Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.