fixAnchorPing

Last update on Jan 20, 2006

Clear the ping attribute on an HTML anchor

The HTML specification allows a ping attribute on an HTML anchor. When clicked, this sends information back to the specified web server without the user's knowledge. This script will replace the ping attribute's value with an empty string.

More info at http://whatwg.org/specs/web-apps/current-work/#...




You could comment on this script if you were logged in.

1 comment Feed-icon

1 point
login to vote
Junk Blocker scriptwright
Posted Feb 20, 2007

Much simplified version:

(function() {

var tags = document.getElementsByTagName("a");

var numofAnchorTags = tags.length;

var x = 0;

while(x < numofAnchorTags) {

try {

if (tags[x].hasAttribute('ping')) tags[x].removeAttribute('ping');

}

catch(e) {}

x++;

}

})();