"How to make that the page opened in a new window"

"How to make that the page opened in a new window"

Digital Hits: 65

When you think over how your website should function whether you define, in particular, any given text-based or graphic hyperlink should load the page to which she points, into the same window of the browser or into new. That a link was opened in the same window of nothing to add or it is not necessary to change in the code of the page - such behavior of links is set by default. And to open them in a new window it is necessary to add the required reference with the relevant information.

Instruction

1. Use the target attribute of tag a (anchor) to let know to the visitor's browser how it is necessary to open a hyperlink in the page of your website. As all elements of the page are recreated by the browser from the HTML-code (HyperText Markup Language - "hypertext markup language") which sends it the server in response to request of the page, and information on a method of opening of the link should be placed in the source code too. The tag is a command to the browser to display a hyperlink in this place of the page. It can look in the HTML-code of the page, for example, so: <a href= "" / ""> the Text reference </a> Here href is additional information of the tag of the link which in the HTML language is called "attribute". In this attribute the address to which the visitor should be sent is specified, but language standards provided also other attributes. That from them which contains information on a way of opening of this link is designated as target. In total this attribute can have four values: _blank, _parent, _self and _top. Value necessary to you - _blank. The link given above with the instruction added to it to the browser opens the page in a new window can look, for example, so: <href= "" / "" of target= "" _blank""> Text reference </a>

2. Open for editing the page the containing reference to which it is necessary to add the target attribute. It is possible to make it in the normal text editor, having downloaded the file of the page from the server to itself in the computer. And it is possible to use the editor of pages of a management system of the website. Anyway, after opening of the source code of the page you should find that reference which should be changed and to add in it (for example, right after a name of the tag - ""a"") target= "" _blank"". Then save changes in the code of the page.

3. If you have an opportunity to use a visual editing mode in a management system of the website, then the procedure can be even simpler - many visual editors allow to specify the target attribute in a dialog of creation/change of the link. It is enough to select the necessary hyperlink and to click on the editor's panel the button "Add the Reference" for opening of such dialog, to select _blank value from a drop-down list of target and to save changes.

Author: «MirrorInfo» Dream Team

Print