HTMLIFrameElement: src 屬性
HTMLIFrameElement.src 屬性是一個字串,它反映了 src HTML 屬性,其中包含要嵌入的內容的地址。
請注意,透過程式設計方式移除 <iframe> 的 src 屬性(例如,透過 Element.removeAttribute())會導致在框架中載入 about:blank。
示例
js
const iframe = document.createElement("iframe");
iframe.src = "/";
const body = document.querySelector("body");
body.appendChild(iframe); // Fetch the image using the complete URL as the referrer
規範
| 規範 |
|---|
| HTML # dom-iframe-src |
瀏覽器相容性
載入中…