Both twitter and facebook use iframe’s. The nasty javascript code they supply runs on the clients PC after your page has been sent to the client and inserts HTML code into your page. How dare it not be W3C compliant! After being annoyed by this I created my own buttons and a php script to fetch the counter values so I could insert them into my page myself BEFORE the client receives it.
// get twitter count
$url = 'https://www.YOURDOMAINHERE.COM';
$twitterUrl = 'https://urls.api.twitter.com/1/urls/count.json';
$twitterQuery = urlencode($url) . '&callback=twttr.receiveCount';
$twitterStr = file_get_contents("$twitterUrl?url=$twitterQuery");
$s = strpos($twitterStr, '{');
$e = strpos($twitterStr, '}');
$l = $e - $s + 1;
$jsonTwitter = json_decode(substr($twitterStr, $s, $l), true);
$twitterCount = $jsonTwitter['count'];
// get facebook count
$url = 'https://www.YOURDOMAINHERE.COM';
$facebookUrl = 'https://graph.facebook.com';
$facebookQuery = urlencode($url);
$facebookStr = file_get_contents("$facebookUrl?ids=$facebookQuery");
$jsonFacebook = json_decode($facebookStr, true);
$facebookCount = $jsonFacebook[$url]['shares'];