What does the _help target do?

I find it difficult to find information related to target="_help" on the Internet. So, when I have an HTMLAnchorElement like this:

 <a href="http://www.google.com" target="_help"></a> 

I see that this thing really behaves like target="_blank" , but something else?

Could not find anything on MDN . Also not mentioned is HTML5 Spec and the detailed W3C Browsing Context p.

+5
source share
2 answers

According to MDN :

This attribute indicates where to display the associated resource. In HTML4, this is the name or keyword for the frame. In HTML5, this is the name or keyword for the viewing context (for example, tab, window or inline frame).

It means click

 <a href="http://www.google.com" target="_help"></a> 

instructs an iframe named _help set the src value to href . The example below downloads youtube video:

 <a href="http://www.youtube.com/embed/M7lc1UVf-VE" target="_help">Help</a> <iframe name="_help"></iframe> 

JSBin .

On the one hand, this function looks rather obscure, I did not know about it before your question.

+4
source

As mdn says:

target

This attribute indicates where to display the associated resource. In HTML4, this is the name or keyword for the frame. In HTML5, this is the name or keyword for the viewing context (for example, tab, window or inline frame). The following keywords have special meanings:

_self:

Load the response in the same HTML4 frame (or HTML5 viewing context) as the current one. This value is the default if no attribute is specified.

_blank:

Download the response in a new, untitled HTML4 window or HTML5 viewing context.

_parent:

Load the response into the parent HTML4 frameset of the current calendar or the parent context of the current HTML5 view. If there is no parent, this parameter behaves the same as itself.

_top:

In HTML4: Load the response into the full, original window, undoing all other frames. In HTML5: Load the response into a top-level view context (that is, a view context that is the ancestor of the current one and has no parent). If there is no parent, this parameter behaves the same as itself.

So, if you use any other key besides these 4 keys (_self, _parent, _top, _blank), it opens a blank window and gives the name with the key that you wrote in the target attibute to this window.

You can check:

https://developer.mozilla.org/en/docs/Web/HTML/Element/a#attr-target

+3
source

Source: https://habr.com/ru/post/1242276/


All Articles