Easy markdown target blank6/25/2023 ![]() ![]() This approach puts less stress on system resources (as the same window/frame is reused). Using a named target attribute value (such as target="_new", etc.) will, in almost all modern browsers, create a new single secondary window which is recycled and reused. Also with this approach, if several such links are clicked on, it can easily lead to visual clutter, and possibly the browser using more system resources for having multiple windows/tabs open. This requires more system resources (when creating a secondary window each time) as compared to a named target (in which case the same window is reused). Using target="_blank" would create a new, unnamed window each time (which cannot be reused). When using _blank make sure to also set rel="noopener" on the anchor tag, to prevent potential security risks. Target="_blank" on the other hand, is a part of the official standard, and works by opening a link in a new window each time. However, if no such frame existed in the current window, then (as mentioned earlier) most browsers would open the link in a new window (or tab) and replace it with a new url each time another link with the same target value was clicked on. In the example above, all links with target="_new" would load in the iframe (because its name matches the link target). To prove the point about target="_new" behaving the same way as target="framename", let's take a look at the following example: However, most browsers ignore that rule, which is why we have non-standard values such as _new behaving the same way. If no such frame exists, most browsers would open the link in a new window, with all subsequent links with the same framename replacing the previously loaded page in that window.Īs per the official standard, framename must begin with an alphabet (lower or upper case). Opens link in a frame that has the name attribute value matching the target framename. This is equivalent to _self if the current frame has no parent. Opens link into the original window (canceling all other frames). Opens link in the parent of the current frame. Opens link in the same frame as it was clicked. The target attribute only supports the following (case-insensitive) values: Before we dive into the differences between target _blank and _new, it is important to know that _new is not a valid value for the target attribute.
0 Comments
Leave a Reply. |