Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How cross browser is the ping attribute of anchor elements?

<a ping="..."> is a relatively new, relatively unknown attribute in HTML5's anchor element.

How cross-browser compliant is it?

I've looked at online sources like MDN and http://caniuse.com, but found nothing that suggest browser support.

I want to know if it's a viable option for link tracking today in 2014.

like image 381
Madara's Ghost Avatar asked Mar 15 '14 19:03

Madara's Ghost


People also ask

Which anchor attribute defines where a link will open in a browser?

a target=”_blank” Open in New Browser Tab (or Window) The target attribute specifies where the linked document will open when the link is clicked.

What is ping attribute?

The ping attribute specifies a list of URLs to be notified if the user follows the hyperlink. When the user clicks on the hyperlink, the ping attribute will send a short HTTP POST request to the specified URL. This attribute is useful for monitoring/tracking.

What attribute and value can you use to cause an A element to open the link in a new browser tab?

You just need an anchor ( <a> ) element with three important attributes: The href attribute set to the URL of the page you want to link to. The target attribute set to _blank , which tells the browser to open the link in a new tab/window, depending on the browser's settings.

What is an anchor tag in HTML explain in detail?

An anchor is a piece of text which marks the beginning and/or the end of a hypertext link. The text between the opening tag and the closing tag is either the start or destination (or both) of a link. Attributes of the anchor tag are as follows. HREF. OPTIONAL.


1 Answers

The ping attribute was included in pre-W3C drafts of HTML5. It remained in W3C drafts of HTML5 up until early 2010 - the last draft to include it was W3C Working Draft 4 March 2010; the next draft was W3C Working Draft 24 June 2010.

Why was it removed? It was massively unpopular - an HTML feature designed for advertisers to track clicks on adverts. Hixie's argument was that they can already do that; ping just made the process more transparent. And browsers would be able to offer a feature to block ping tracking. The counter-argument to that is that if browsers had this feature, publishers would avoid ping, it being unreliable compared to current click-tracking techniques.

Some browsers support it because of a combination of:

  • They implemented it early, and haven't felt a need to remove it; and
  • They support the WHATWG spec instead of or as well as the W3C spec.

Browsers that support it seem to be Safari and Chrome. (It's no surprise that the latter does; it originally used Safari's WebKit as its layout engine, and now uses Blink, a fork of WebKit.) Firefox also supports it, but since 2008, support has been disabled by default - it can be enabled through about:config, though I don't suppose many people do.

Internet Explorer does not support it (yet?). Opera 12.x does not support the attribute, but I haven't checked in Opera's next generation of Blink-based browsers.

like image 195
tobyink Avatar answered Sep 19 '22 23:09

tobyink