Skip to content

Commit

Permalink
document for HTMLAnchorElement.ping (#31904)
Browse files Browse the repository at this point in the history
* document for HTMLAnchorElement.ping

document for HTMLAnchorElement.ping

document for HTMLAnchorElement.ping

typo

corrections

* Update files/en-us/web/api/htmlanchorelement/ping/index.md

Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>

* Update files/en-us/web/api/htmlanchorelement/ping/index.md

Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>

* property list update

* content and example update

* Update files/en-us/web/api/htmlanchorelement/index.md

Co-authored-by: skyclouds2001 <[email protected]>

* Update files/en-us/web/api/htmlanchorelement/ping/index.md

Co-authored-by: skyclouds2001 <[email protected]>

---------

Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
Co-authored-by: skyclouds2001 <[email protected]>
  • Loading branch information
3 people authored Jan 29, 2024
1 parent 7eab8d4 commit 2bcfdc3
Show file tree
Hide file tree
Showing 2 changed files with 45 additions and 0 deletions.
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 {{HTTPMethod("POST")}} requests with the body PING to the URLs.
- {{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 {{HTTPMethod("POST")}} requests with the body PING to the URLs.

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

0 comments on commit 2bcfdc3

Please sign in to comment.