Open the file 1.htmin the main window, and pop up the window page.html at the same time]
Add the following code to the <Script language = "javascript"> "〉
<〈! --
Function openwin (){
Window. open ("page.html", "", "width = 200, height = 200 ")
}
// --> //--〉
</Script> 〉
Join the <body> area:
<A href = "1.htm" onclick =" openwin () "> open </a>.
[6. timed close control for the pop-up window]
Next we will make some control over the pop-up window, and the effect will be better. If we add the field code to the page that pops up (the page is added to the HTML of page.html, not the page, otherwise...), will it be cool to enable it to be automatically disabled in 10 seconds?
First, add the following code to the
<Script language = "JavaScript"> "〉
Function closeit (){
SetTimeout ("self. close ()", 10000) // millisecond
}
</Script> 〉
Then, use the "body onload =" closeit () "> statement to replace the original" BODY "sentence in page.html. (Do not forget to write this sentence! The function of this statement is to call the code for closing the window. The window will be closed in 10 seconds .)
7. Add a close button in the pop-up window]
<FORM> 〉
<Input type = 'button 'value = 'close 'onclick = 'window. close ()'> ()'〉
</FORM> 〉
Now it's more perfect!
[8. pop-up window contained in the Content-one page and two windows]
The preceding example contains two windows: one is the main window and the other is the small window that appears. Through the example below, you can complete the above effect on a page.
<Html> 〉
<Head> 〉
<Scrit language = "JavaScript"> "〉
Function openwin ()
{
OpenWindow = window. open ("", "newwin", "height = 250,
Width = 250, toolbar = no, scrollbars = "+ scroll +", menubar = no ");
// Write a row
Opendeskdoc ument. write ("<TITLE> example </TITLE> 〉")
Openmediaworkflow Doc ument. write ("<body bgcolor = # ffffff> 〉")
Openmediaworkflow Doc ument. write ("Openmediaworkflow Doc ument. write ("New window opened! ")
Openmediaworkflow Doc ument. write ("</BODY> 〉")
Openmediaworkflow Doc ument. write ("</HTML> 〉")
Openmediaworkflow Doc ument. close ()
}
</SCRIPT> 〉
</Head> 〉
<Body> 〉
<A href = "#" onclick = "openwin ()"> open a window </a> 〉
<Input type = "button" onclick = "openwin ()" value = "open window"> "〉
</Body> 〉
</Html> 〉
Do you think the code in openmediaworkflow Doc ument. write () is not standard HTML? You only need to write more rows according to the format. An error occurs when you add one or more labels. Remember to end with opentracing upload Doc ument. close.