Three ways to refresh iframe

Three ways to refresh iframe

Copy code
The code is as follows:

<iframe src="1.htm" name="ifrmname" id="ifrmid"></iframe>

Option 1:
Use the iframe's name attribute to locate

Copy code
The code is as follows:

<input type="button" name="Button" value="Button" onclick="document.frames('ifrmname').location.reload()"> or
<input type="button" name="Button" value="Button" onclick="document.all.ifrmname.document.location.reload()">

Option 2:
Use the iframe id attribute to locate

Copy code
The code is as follows:

<input type="button" name="Button" value="Button" onclick="ifrmid.window.location.reload()">

The Ultimate Solution:
When the src of the iframe is another website address (cross-domain operation)

Copy code
The code is as follows:

<input type="button" name="Button" value="Button" onclick="window.open(document.all.ifrmname.src,'ifrmname','')">

<<:  Sample code for implementing 3D rotation effect using pure CSS

>>:  Vuex modularization and namespaced example demonstration

Recommend

Zabbix configures DingTalk's alarm function with pictures

Implementation ideas: First of all, the alarm inf...

How to install and configure the Docker Compose orchestration tool in Docker.v19

1. Introduction to Compose Compose is a tool for ...

js realizes the function of clicking to switch cards

This article example shares the specific code of ...

Solve MySQL deadlock routine by updating different indexes

The previous articles introduced how to debug loc...

Record a slow query event caused by a misjudgment of the online MySQL optimizer

Preface: I received crazy slow query and request ...

Solution to the problem that VC6.0 cannot be used when installed on WIN10

VC6.0 is indeed too old VC6.0 is a development to...

Implementation of React star rating component

The requirement is to pass in the rating data for...

How to modify the "Browse" button of the html form to upload files

Copy code The code is as follows: <!DOCTYPE HT...

The difference between mysql outer join and inner join query

The syntax for an outer join is as follows: SELEC...

How to resize partitions in CentOS7

Yesterday, I helped someone install a system and ...