Haradzieniec
Haradzieniec

Reputation: 9338

Html: open the page in a new window. target="_blanck" - is that a typo?

I have found (with a letter c)

target="_blanck"

instead of expected

target="_blank"

in a project written by someone else. It works and opens a link in a new window. Is that a typo or am I missing something?

Upvotes: 2

Views: 5200

Answers (4)

Ronak Joshi
Ronak Joshi

Reputation: 1583

The main method to give hyperlink in HTML is,

<a href="url" target="_blank">CLick Here ...</a>

where is HTML tag and href and target is attribute. If you write target="_blanck" its means that you have an HTML page named _blanck and its gives you error.

Upvotes: 0

Xavi L&#243;pez
Xavi L&#243;pez

Reputation: 27880

The target attribute refers to where the contents of the link will be loaded in your browser. The browser will put the contents of the page inside the window/frame with that name, as long as it's not one of the special values _blank, _self, _top or _parent. See the Frame target references section in the w3 spec.

Except for the reserved names listed below, frame target names (%FrameTarget; in the DTD) must begin with an alphabetic character (a-zA-Z). User agents should ignore all other target names.

The following target names are reserved and have special meanings.

_blank The user agent should load the designated document in a new, unnamed window.
_self The user agent should load the document in the same frame as the element that refers to this target.
_parent The user agent should load the document into the immediate FRAMESET parent of the current frame. This value is equivalent to _self if the current frame has no parent.
_top The user agent should load the document into the full, original window (thus canceling all other frames). This value is equivalent to _self if the current frame has no parent.

So, if the link is supposed to always open a new window, it should be _blank. If there are several links with the same target=_blanck, it might be like this on purpose if they're supposed to always replace the contents of the same window.

See this fiddle:

<a href="http://www.stackoverflow.com" target="_blank">This opens SO always in a new window</a>
<a href="http://www.google.com" target="_blanck">This opens google in a given window</a>
<a href="http://www.stackoverflow.com" target="_blanck">This opens SO in the same given window</a>

Upvotes: 2

Vlad
Vlad

Reputation: 795

The correct way is: <a href="/" target="_blank">Home</a>

Upvotes: 0

cowls
cowls

Reputation: 24354

Yes its a typo

target="_blank"

Will open in a new window

target="_blanck"

Will open in a tab named blanck, if there is not a tab named blanck it will open a new one.

My guess is if you click that link it will open in a new window, click it again and it will reload the same tab it opened previously

Upvotes: 2

Related Questions