HTMLAreaElement: ping 屬性
HTMLAreaElement 介面的 ping 屬性是一個由空格分隔的 URL 列表。當用戶點選連結時,瀏覽器會向這些 URL 傳送帶有 PING 的 POST 請求。
它反映了 <area> 元素的 ping 屬性。
注意:此屬性在 Firefox 中無效,並且可能因隱私和安全原因而受到限制。
示例
html
<map>
<area
href="https://example.com"
ping="https://example-tracking.com https://example-analytics.com"
alt="example" />
</map>
js
const areaCollection = document.getElementsByTagName("map")[0].areas;
console.log(areaCollection[0].ping); // Output: "https://example-tracking.com https://example-analytics.com"
規範
| 規範 |
|---|
| HTML # dom-area-ping |
瀏覽器相容性
載入中…