Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

document for HTMLAnchorElement.ping #31904

Merged
merged 7 commits into from
Jan 29, 2024
Merged
Show file tree
Hide file tree
Changes from 5 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions files/en-us/web/api/htmlanchorelement/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,8 @@ _Inherits properties from its parent, {{domxref("HTMLElement")}}._
- : A string containing the password specified before the domain name.
- {{domxref("HTMLAnchorElement.pathname")}}
- : A string containing an initial `'/'` followed by the path of the URL, not including the query string or fragment.
- {{domxref("HTMLAnchorElement.ping")}}
- : A space-separated list of URLs. When the link is followed, the browser will send POST requests with the body PING to the URLs.
ShubhamOulkar marked this conversation as resolved.
Show resolved Hide resolved
- {{domxref("HTMLAnchorElement.port")}}
- : A string representing the port component, if any, of the referenced URL.
- {{domxref("HTMLAnchorElement.protocol")}}
Expand Down
43 changes: 43 additions & 0 deletions files/en-us/web/api/htmlanchorelement/ping/index.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
---
title: "HTMLAnchorElement: ping property"
short-title: ping
slug: Web/API/HTMLAnchorElement/ping
page-type: web-api-instance-property
browser-compat: api.HTMLAnchorElement.ping
---

{{ApiRef("HTML DOM")}}

The **`ping`** property of the {{domxref("HTMLAnchorElement")}} interface is a space-separated list of URLs. When the link is followed, the browser will send POST requests with the body PING to the URLs.
ShubhamOulkar marked this conversation as resolved.
Show resolved Hide resolved

It reflects the `ping` attribute of the {{HTMLElement("a")}} element.

> **Note:** This property is not effective in Firefox and its usage may be limited due to privacy and security concerns.

## Example

```html
<a
id="exampleLink"
href="https://example.com"
ping="https://example-tracking.com https://example-analytics.com"
>Example Link</a
>
```

```js
const anchorElement = document.getElementById("exampleLink");
console.log(anchorElement.ping); // Output: "https://example-tracking.com https://example-analytics.com"
```

## Specifications

{{Specifications}}

## Browser compatibility

{{Compat}}

## See also

- {{domxref("HTMLAreaElement.ping")}} property
Loading