How to open a page in an iframe

How to open a page in an iframe
Solution:
Just set the link's target attribute value to the same as the target framework name.
Specific steps:
1: For frameset object.
(1) Contains the code of the frame page.

<frameset cols="100,*" name="frame1">
<frame src="1.htm" name="top">
<frame src="2.htm" name="main">
</frameset>

(2) Link code of the frame loading page (1.htm or 2.htm):

<a href="http://www.flash8.net" target="top">Open the link in the upper box</a>
<a href="http://www.flash8.net" target="main">Open the link in the main frame</a>

2. The same usage applies to iframe.

<iframe src="about:blank" name="left"></iframe>
<iframe src="about:blank" name="right"></iframe>
<a href="http://www.flash8.net" target="left">Open the link in the left frame</a>
<a href="http://www.thugx.com" target="right">Open link in right frame</a>

Tip: You can also achieve the same purpose by setting the location property value of the target frame in the script. like:
<a href="http://www.flash8.net"
onClick="document.frames['right'].location=this.href;return false">Open the link in the frame named right</a>

Special note: After running this code, click the link and the link target will be opened in the specified frame or iframe. Figure 1.6.6 shows the effect of the link opening in the specified iframe after clicking the link.

Figure 1.6.6 Open the link target in the specified iframe

Special Notes

This example mainly uses the target attribute of the link and the name attribute of the frame. When the values ​​of the two attributes are the same, the link target is opened in the frame.
target Sets or gets the window or frame in which the target content is to be displayed.
name Sets or gets the name of the frame.

<<:  Sharing ideas on processing tens of millions of data in a single MySQL table

>>:  How to use nginx to configure access to wgcloud

Recommend

JavaScript Basics Variables

Table of contents 1. Variable Overview 1.1 Storag...

Detailed explanation of the specific use of the ENV instruction in Dockerfile

1. The ENV instruction in the Dockerfile is used ...

Detailed explanation of the process of building and running Docker containers

Simply pull the image, create a container and run...

HTML Tutorial: Definition List

<br />Original text: http://andymao.com/andy...

JS implements array filtering from simple to multi-condition filtering

Table of contents Single condition single data fi...

In-depth understanding of javascript class array

js array is probably familiar to everyone, becaus...

Nginx uses the Gzip algorithm to compress messages

What is HTTP Compression Sometimes, relatively la...

Solutions to the Problem of Creating XHTML and CSS Web Pages

The solutions to the problems encountered during x...

Pure CSS to achieve left and right drag to change the layout size

Utilize the browser's non- overflow:auto elem...

Detailed tutorial on replacing mysql8.0.17 in windows10

This article shares the specific steps of replaci...

7 Best VSCode Extensions for Vue Developers

Adding the right VS Code extension to Visual Stud...

Web Design Experience: Self-righteous Web Designers

1. Trash or Classic? Web technology updates very ...

Steps to run ASP.NET Core in Docker container

There are too much knowledge to learn recently, a...

MySQL5.7 parallel replication principle and implementation

Anyone who has a little knowledge of data operati...