In JavaScript, Windows represents a Window object. So throughout the entire process, all operations are based on a bullet frame
Of
Example 1: Using the warning box
<script type= "Text/javascript" >
Window.alert ("Hello World");
</script>
Code:
:
Using window to implement data input operations
Example 2: Observing the input operation of the data
<script type= "Text/javascript" >
var name = window.prompt ("Please enter your name", "Your Name");
document.write ("
</script>
Code:
:
When default:
When you enter your name:
Output Result:
You can also open other child windows within the Window object.
Example 3: Open another window
<script type= "Text/javascript" >
window.open ("pass.html");
</script>
Code:
:
When default:
Set not to block windows:
Click "Yes" to open the window:
There is a very interesting feature in the Windows window: Confirmation box.
Example 4: Delete is required to confirm
<script type= "Text/javascript";
Window.onload = function () {
document.getElementById ("Deletebtn"). AddEventListener (' click ', Function () {
if ( Window.confirm ("OK to delete?") ") {
window.location =" pass.html "; Jumps to the specified path
}
},false);
& Lt;/script>
Code:
:
By default, click "Delete Message" and a confirmation box appears:
Click "OK" to jump to the specified path interface:
Summarize:
1. Do not use warning box, use once can;
2. Confirm the confirmation before performing some important updates;
The 3.window.location can be jump-operated.
Javascript:window Window objects