3.3.2021 |

Ping Attribute in a tags

The ping attribute can be included in <a> tag to automatically send a POST request to the provided URL(s) whenever the link is clicked.

<!-- on clicking ping would be sent to https://usefulangle.com/track -->
<a href="https://usefulangle.com/post/288/html-output-tag" ping="https://usefulangle.com/track">Click here</a>

Multiple Pings, separated with whitespace

<!-- on clicking ping would be sent to https://usefulangle.com/track -->
<a href="https://usefulangle.com/post/288/html-output-tag" ping="https://usefulangle.com/track http://someserver.com/notify">Click here</a>

What is a Ping?

  • Ping is basically a HTTP POST request.
  • Request body of this POST request just contains the string PING.
  • Request does not wait for a response from the server.

By using the ping attribute, browser automatically sends a HTTP request upon a click. No custom code is required. The request will be sent even if the user has disabled Javascript.

Zur Übersicht
Umut Tufanoglu

Mehr vom Devsquad...

Jan Sauer

Java15

Rahmi Tufanoglu

Angular - Funktionsaufrufe in Templates vermeiden

Hallo, ich bin Jörg Herbst!

Ich bin der CEO von newcubator und freue mich über jede Nachricht!

* Pflichtfeld