Web Guide  > webguide > 6. Construction > 6.2 HTML and coding > 6.2c New windows and pop-ups

6.2c New windows and pop-ups

Policy

New windows

The term "new window" refers to the action of clicking on a link within a Web page and a new browser window opening.
Avoid opening links in new windows as this can be confusing for users and many people find them annoying.
If the new window displays content from another site, the user can become very disoriented. They can also cause problems for screen-reader users as they change the focus without warning.

It is recommended to only open links in new windows when linking to PDF files.

The code

If you do decide to open a link in a new window, add a warning message in the link or 'alt' text such as "this will open in a new window".

Including the warning as part of the hyperlink makes the link title more meaningful when read out of context, e.g. by screen-reader users .

Ensure that the HTML code for linking (a href=http://www.fao.org></a>) contains the code: target="_new".

This instructs the page to open in a different browser window, but as successive links are opened, they will only open in this one browser window.

Pop-ups

Pop-ups are new windows that can open automatically. Do not generate pop-ups without first informing the user.

Pop-up windows used to display error messages in forms should be avoided as they can cause problems. The user has to read the content of the pop-up window, navigate back to the main page, and then find the relevant position on the form again before they can fix the error.