Ask Làm thế nào để reload 1 frame trên web?

phambaothuy.nga

New member
## Làm thế nào để tải lại 1 khung trên web?

<br>

** 1.Khung là gì? **

Một khung là một phần của trang web có thể được hiển thị độc lập với phần còn lại của trang.Khung được tạo bằng thẻ `<rame>`.

<br>

** 2.Làm thế nào để tải lại một khung? **

Có hai cách để tải lại một khung:

*** Sử dụng thẻ `<frame>`: ** TAG `<FRAME>` cho phép bạn nhúng khung từ một trang web khác vào trang của riêng bạn.Để tải lại khung, bạn có thể sử dụng thuộc tính `src`.Ví dụ: mã sau sẽ tải lại khung với URL `https: // example.com/frame.html`:

`` `HTML
<iframe src = "https://example.com/frame.html"> </iframe>
`` `

*** Sử dụng `window.location.reload ()` Phương thức: ** `window.location.reload ()` Phương thức tải lại trang hiện tại.Bạn có thể sử dụng phương thức này để tải lại một khung bằng cách chuyển `id` hoặc` name` của khung làm tham số.Ví dụ: mã sau sẽ tải lại khung hình với `id`` myframe`:

`` `JavaScript
window.location.Reload (MyFrame);
`` `

<br>

** 3.Ví dụ**

Ví dụ sau đây cho thấy cách tải lại khung bằng cách sử dụng thẻ `<frame>`:

`` `HTML
<iframe src = "https://example.com/frame.html"> </iframe>
`` `

Khi bạn nhấp vào nút sau, khung sẽ được tải lại:

`` `HTML
<nút onclick = "window.location.reload ('myFrame');"> Tải lại khung </nút>
`` `

<br>

**4.Phần kết luận**

Tải lại một khung là một quy trình đơn giản có thể được thực hiện bằng cách sử dụng thẻ `<Frame>` hoặc phương thức `window.location.reload ()`.

<br>

## hashtags

* #phát triển web
* #JavaScript
* #html
* #CSS
* #Frames
=======================================
## How to reload 1 frame on the web?

<br>

**1. What is a frame?**

A frame is a part of a web page that can be displayed independently of the rest of the page. Frames are created using the `<frame>` tag.

<br>

**2. How to reload a frame?**

There are two ways to reload a frame:

* **Using the `<iframe>` tag:** The `<iframe>` tag allows you to embed a frame from another website into your own page. To reload the frame, you can use the `src` attribute. For example, the following code will reload the frame with the URL `https://example.com/frame.html`:

```html
<iframe src="https://example.com/frame.html"></iframe>
```

* **Using the `window.location.reload()` method:** The `window.location.reload()` method reloads the current page. You can use this method to reload a frame by passing the frame's `id` or `name` as a parameter. For example, the following code will reload the frame with the `id` `myframe`:

```javascript
window.location.reload(myframe);
```

<br>

**3. Example**

The following example shows how to reload a frame using the `<iframe>` tag:

```html
<iframe src="https://example.com/frame.html"></iframe>
```

When you click on the following button, the frame will be reloaded:

```html
<button onclick="window.location.reload('myframe');">Reload frame</button>
```

<br>

**4. Conclusion**

Reloading a frame is a simple process that can be done using either the `<iframe>` tag or the `window.location.reload()` method.

<br>

## Hashtags

* #web development
* #JavaScript
* #html
* #CSS
* #Frames
 
Join ToolsKiemTrieuDoGroup
Back
Top
AdBlock Detected

We get it, advertisements are annoying!

Sure, ad-blocking software does a great job at blocking ads, but it also blocks useful features of our website. For the best site experience please disable your AdBlocker.

I've Disabled AdBlock