Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

When to use target="_self"

When does the _self frame target becomes useful or worth using it?

Isn't it (always?) the default behavior?

like image 530
talles Avatar asked Apr 02 '13 18:04

talles


People also ask

Should you use target _blank?

There's A Security Reason For Not Using _BlankThe target=”_blank” link attribute is risky and opens a website to security and performance issues. Google's Web. dev page on the risks of using the _blank link attribute is summarized as such: “The other page may run on the same process as your page.

Why do we need to use the target attribute?

The target attribute specifies a name or a keyword that indicates where to display the response that is received after submitting the form. The target attribute defines a name of, or keyword for, a browsing context (e.g. tab, window, or inline frame).

What is the use of target property of anchor tag?

The target attribute inside anchor tags ( <a> ) tells the browser where the linked document should be loaded. It's optional, and defaults to _self when no value is provided.


1 Answers

The default can be changed by using the <base> tag in the <head>:

<base href="http://www.mysite.com/" target="_blank"/> 

In this case, you can use target="_self" on a link to override the target set by base.

like image 198
Adrian Avatar answered Sep 21 '22 16:09

Adrian