The essence of web page code collection

by zzymale on 2008-01-10 10:37:12

### [1. Ordinary Pop-up Window]

In fact, the code is very simple:

```html

```

Since this is a piece of JavaScript code, it should be placed between the `` tag and the `` tag. The `` are used to ensure compatibility with older browsers; in these older browsers, the code inside the tags will not be displayed as plain text. It's a good habit to include them.

The line `window.open ('page.html')` is used to control the opening of a new window named `page.html`. If `page.html` is not in the same directory as the main window, you should specify the path, either an absolute path (starting with `http://`) or a relative path (e.g., `../`).

Both single quotes (`'`) and double quotes (`"`) can be used, but don't mix them.

This piece of code can be inserted anywhere in the HTML file, whether between `` and ``, or between `` and ``. The earlier it appears in the code, the sooner it will execute. Especially for long pages where you want the pop-up to appear as soon as possible, it's best to place this code near the top.

---

### [2. Customized Pop-up Window]