Open a new window with the window.open parameter of HTML
regular Internet friends may have been to such a number of websites, a window into the front page will pop up a window,
or one A connection or button pops up, usually in this window that displays some notices, copyright information
, warning, welcome patronage, or other information that the author wants special hints. In fact, making such a page
is very easy, as long as you add a few Javascript code to the HTML of the page, you can achieve it. Next
face I will take you to analyze its mystery.
[1, the most basic pop-up window code]
the code is very simple:
[code].lt; SCRIPT LANGUAGE=.quot; javascript.quot;.Gt;
.lt;! LANGUAGE=.quot; javascript.quot;.Gt; tags and.Lt; /script.gt; between. .lt;! -- and --.gt; it works for some low version browsers and will not display the code in the label as text in this
older browsers. Get into this good habit.
window.open ('page.html') is used to control the new pop-up window page.html. If page.html
is not in the same path as the main window, the path, the absolute path (http://) and the relative path (.. /) can be written in front of the same path.
use single quotes and double quotes, but do not mix them.
this section of the code can be added to any location of HTML,.Lt; head.gt; and.Lt; /head.gt;.Lt; body.gt;.Lt; /body.gt; also, the earlier, the earlier, especially the page code length, and want the page to pop up as soon as possible to
.