Let the user click OK to cancel. Let the user enter a value. Opens the specified window Alert ("Message") Confirm (' message ') prompt ("message") Open ("url") http://www.maobuy.cn First of all, I would like to say a few words about JavaScript, I hope that we can seriously learn this programming language, because it gives us in the development of Web pages, will bring a lot of surprises. JavaScript is generally run on the client side, mainly for the development of some Web page dynamic effect, in fact, it has a lot of use, such as validating the form content, and now more popular AJAX applications. Today I'll write a pop-up dialog box in javascript: First: Alert ("message") The second type: Confirm ("message") Third clock: Prompt ("message") Type Fourth: open ("url") The First Alert dialog box is the simplest and most commonly used pop-up dialog box, usually for informational purposes, the dialog box contains a button, and clicking the button in the dialog box closes the dialog box. The Second confirm dialog box returns a Boolean value, which is typically used for user selection, which contains two buttons, generally one is "confirm", the other is "Cancel", for example, when we are developing a program, we create a delete button to prevent the user from doing business, This dialog box is commonly used: "Are you sure you want to delete it?" "If you choose OK, perform the deletion, and if you choose Cancel, return without any action." The third kind of prompt dialog box, the main user gets the user input information, for example, a pop-up dialog box: <script language= "JavaScript" > var name=prompt ("What is your name?"); document.write (name); </script> The prompt dialog box includes two buttons ("Confirm" and "Cancel") and a text box that gets the information the user enters. The fourth type is actually a dialog box to open a Web page, the open method contains a lot of parameters, mainly the user settings browser display appearance: window.open ("Webpage.asp?", Derek, "Height=100,width=100,status=yes,toolbar=yes, Menubar=no,location=no"); This statement opens a new window, the page is webpage.asp, the parameter is Var, the name is Derek, the height is 100, the width is 100, the status bar and the toolbar are displayed, and the menu and address are not displayed. The individual property parameters that the summarizes are as follows: window = Object.open ([URL] [, name] [, features] [, replace]]] URL: The URL address of the new window Name: The name of the new window, which can be null Featurse: Property Control string, which controls the various properties of the window, separated by commas. fullscreen= {yes/no/1/0} is full screen, default no channelmode= {yes/no/1/0} whether the Channel bar is displayed, and the default no toolbar= {yes/no/1/0} displays the work With bar, default no location= {yes/no/1/0} displays address bar, default no directories = {yes/no/1/0} show turn button, default no status= {YES/NO/1 /0} whether the window status bar is displayed, the default no menubar= {yes/no/1/0} shows the menu, the default no scrollbars= {yes/no/1/0} whether the scroll bar is displayed, the default Yes Resizable= {yes/no/1/0} whether the window can be resized, default no width=number window width (pixel units) Height=number window height (pixel units) Top=number window away from top of screen (pixel units) Left=number window to the left of screen (pixel units) |