Testing of hyperlink opening target

Testing of hyperlink opening target
The target attribute of a link determines where the link opens. Its values ​​are usually the following five: _blank, _self, _parent, _top, and custom, which are represented by: new window, current window, parent window, top-level window, and frame. When the named frame does not exist, custom has the same effect as _blank. Today we will mainly test which frame the link will be opened in when the frame of the referred name is in a different level of pages or there are frames of the name in different levels of pages?
1. Testing
1. Test 1: The frames with the specified names are in different levels of pages
index.htm:
<iframe name="frame1" src="" width="400" height="400"></iframe>
<iframe src="aaa.htm" width="400" height="400"></iframe>
aaa.htm:
<iframe name="frame2" src="bbb.htm" width="300" height="300"></iframe>
<a href="https://www.jb51.net/" target="frame1">Links</a>
bbb.htm:
<iframe name="frame3" src="" width="200" height="200"></iframe>
Test results:
When target="frame1", it is opened in index.frame1; (For the convenience of explanation, the frame position is uniformly in the format of "page name.frame name")
When target="frame2", it opens in aaa.frame2;
When target="frame3", it opens in bbb.frame3;
2. Test 2: Frames with the same name exist in different levels of pages
index.htm:
<iframe name="frame1" src="" width="400" height="400"></iframe>
<iframe src="aaa.htm" width="400" height="400"></iframe>
aaa.htm:
<iframe name=" frame2 " src="bbb.htm" width="300" height="300"></iframe>
<a href="https://www.jb51.net/" target=" frame2 "> Links</a>
bbb.htm:
<iframe name=" frame2 " src="" width="200" height="200"></iframe>
Test results:
When target="frame2", it opens in aaa.frame2;
3. Test 3: Frames with the same name exist in different levels of pages
index.htm:
<iframe name=" frame2 " src="" width="400" height="400"></iframe>
<iframe src="aaa.htm" width="400" height="400"></iframe>
aaa.htm:
<iframe name=" frame2 " src="bbb.htm" width="300" height="300"></iframe>
<a href="https://www.jb51.net/" target=" frame2 "> Links</a>
bbb.htm:
<iframe name="frame3" src="" width="200" height="200"></iframe>
Test results:
When target="frame2", it opens in aaa.frame2;
4. Test 4: Frames with the same name exist in different levels of pages
index.htm:
<iframe name=" frame1 " src="" width="400" height="400"></iframe>
<iframe src="aaa.htm" width="400" height="400"></iframe>
aaa.htm:
<iframe name="frame2" src="bbb.htm" width="300" height="300"></iframe>
<a href="https://www.jb51.net/" target=" frame1 "> Links</a>
bbb.htm:
<iframe name=" frame1 " src="" width="200" height="200"></iframe>
Test results:
When target="frame1", it opens in bbb.frame1;
2. Conclusion <br />When you want to open a link, first search for the frame with the specified name (target) in this page. If it is not found, search in the lower page. If it is still not found, search in the upper page. If it is not found, open a new window!

<<:  Spring Boot 2.4 new features one-click build Docker image process detailed explanation

>>:  Docker installation and deployment of Net Core implementation process analysis

Recommend

SQL GROUP BY detailed explanation and simple example

The GROUP BY statement is used in conjunction wit...

Solve the problem of using less in Vue

1. Install less dependency: npm install less less...

Super simple qps statistics method (recommended)

Statistics of QPS values ​​in the last N seconds ...

MySQL 5.7.18 Archive compressed version installation tutorial

This article shares the specific method of instal...

Let you understand the working principle of JavaScript

Table of contents Browser kernel JavaScript Engin...

An example of the calculation function calc in CSS in website layout

calc is a function in CSS that is used to calcula...

How is a SQL statement executed in MySQL?

Table of contents 1. Analysis of MySQL architectu...

We're driving IE6 to extinction on our own

In fact, we wonder every day when IE6 will really...

Analysis of the cause of docker error Exited (1) 4 minutes ago

Docker error 1. Check the cause docker logs nexus...

Docker+gitlab+jenkins builds automated deployment from scratch

Table of contents Preface: 1. Install Docker 2. I...

MySQL query statement simple operation example

This article uses examples to illustrate the simp...

el-table in vue realizes automatic ceiling effect (supports fixed)

Table of contents Preface Implementation ideas Ef...

Learn how to use the supervisor watchdog in 3 minutes

Software and hardware environment centos7.6.1810 ...

MySQL 8.0.18 deployment and installation tutorial under Windows 7

1. Preliminary preparation (windows7+mysql-8.0.18...