Title: 1 button W3C validation
Last modified: August 20, 2016

---

# 1 button W3C validation

 *  [drunkfox](https://wordpress.org/support/users/drunkfox/)
 * (@drunkfox)
 * [15 years ago](https://wordpress.org/support/topic/1-button-w3c-validation/)
 * Hi. I apologize for my English, I know it is not the best…
    The plugin works 
   fine, but unfortunately the W3C Validator give me 4 errors. Is it possible to
   resolve?

Viewing 10 replies - 1 through 10 (of 10 total)

 *  Plugin Author [jeremyarntz](https://wordpress.org/support/users/jeremyarntz/)
 * (@jeremyarntz)
 * [15 years ago](https://wordpress.org/support/topic/1-button-w3c-validation/#post-2114940)
 * I can look in to it. What’s your site URL? I just ran WC3 Validation on my own
   site and all the errors that came back involving the Google +1 Button I don’t
   believe are possible to fix, but I can try.
 *  Thread Starter [drunkfox](https://wordpress.org/support/users/drunkfox/)
 * (@drunkfox)
 * [15 years ago](https://wordpress.org/support/topic/1-button-w3c-validation/#post-2114950)
 * Thx for your quick reply.
    My site URL is: [http://www.guidedolomiti.com/wp/](http://www.guidedolomiti.com/wp/)
 *  Plugin Author [jeremyarntz](https://wordpress.org/support/users/jeremyarntz/)
 * (@jeremyarntz)
 * [15 years ago](https://wordpress.org/support/topic/1-button-w3c-validation/#post-2114988)
 * It looks like the Google +1 Button isn’t WC3 Compliant:
 * [http://stackoverflow.com/questions/6217434/google-1-button-not-w3c-compliant](http://stackoverflow.com/questions/6217434/google-1-button-not-w3c-compliant)
 *  [james.ingham](https://wordpress.org/support/users/jamesingham/)
 * (@jamesingham)
 * [15 years ago](https://wordpress.org/support/topic/1-button-w3c-validation/#post-2115073)
 * Hey, I just posted a article about this here: [http://james-ingham.co.uk/posts?p=google-plusone-w3c-valid](http://james-ingham.co.uk/posts?p=google-plusone-w3c-valid).
   Just chuck it in a document.write using javascript and you’ll pass w3c (although
   it isn’t valid). Example code is in that post.
 *  [rdelavega](https://wordpress.org/support/users/rdelavega/)
 * (@rdelavega)
 * [15 years ago](https://wordpress.org/support/topic/1-button-w3c-validation/#post-2115146)
 * The simplest way to make Google Plus One code to validate:
    Just put <div class
   =”g-plusone”></div> instead of <g:plusone></g:plusone>. Drawbacks: you cannot
   add parameters such as ‘count’ or ‘size’, or the code will not be valid any more.
   It’s Google’s proposed code for HTML5, but will work for other (X)HTML flavours.
   In HTML5 you CAN add parameters such as ‘data-count’, data-size’, etc.
 *  [amdamdeath](https://wordpress.org/support/users/amdamdeath/)
 * (@amdamdeath)
 * [14 years, 10 months ago](https://wordpress.org/support/topic/1-button-w3c-validation/#post-2115245)
 * I have the same Problem with my site [http://www.sususumm-shop.de](http://www.sususumm-shop.de).
   I’ve put a googgle +1 in my code and after that there was an error in my validation
   like:
    Line 206, Column 56: Element name g:plusone cannot be represented as XML
   1.0. Is this a google error or can i do something against it.
 *  [amdamdeath](https://wordpress.org/support/users/amdamdeath/)
 * (@amdamdeath)
 * [14 years, 10 months ago](https://wordpress.org/support/topic/1-button-w3c-validation/#post-2115246)
 * Hello rdelavega i’ve tried <div class=”g-plusone”></div>
 * <div class=”g-plusone” size=”small” callback=”www.sususumm-shop.de”></div>
 * but now i have 3 errors instead of 2
 *  [konqi.de](https://wordpress.org/support/users/konqide/)
 * (@konqide)
 * [14 years, 9 months ago](https://wordpress.org/support/topic/1-button-w3c-validation/#post-2115256)
 * Have a look at my post [http://wordpress.org/support/topic/google-plus-one-1-plugin-w3c-validator-neutral](http://wordpress.org/support/topic/google-plus-one-1-plugin-w3c-validator-neutral)
 * Plugin works on my page… Have fun!
 *  [Rupam Guha](https://wordpress.org/support/users/rupamguha/)
 * (@rupamguha)
 * [14 years, 5 months ago](https://wordpress.org/support/topic/1-button-w3c-validation/#post-2115293)
 * for w3c validation for google+, facebook api or twitter plugin you can user javascript
   document.write covered by xml CDATA.
 * please find the following link for more details script,
 * [w3c validation for google +1 and facebook api](http://www.newtechtips.org/tips-and-tricks-to-validate-w3c-for-facebook-fbml-twitter-google-1-and-youtube/)
 *  [Frank Leigh](https://wordpress.org/support/users/frank-leigh/)
 * (@frank-leigh)
 * [14 years ago](https://wordpress.org/support/topic/1-button-w3c-validation/#post-2115330)
 * 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 = 'http://www.YOURDOMAINHERE.COM';
       $twitterUrl = 'http://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 = 'http://www.YOURDOMAINHERE.COM';
       $facebookUrl = 'http://graph.facebook.com';
       $facebookQuery = urlencode($url);
       $facebookStr = file_get_contents("$facebookUrl?ids=$facebookQuery");
       $jsonFacebook = json_decode($facebookStr, true);
       $facebookCount = $jsonFacebook[$url]['shares'];
       ```
   

Viewing 10 replies - 1 through 10 (of 10 total)

The topic ‘1 button W3C validation’ is closed to new replies.

 * ![](https://s.w.org/plugins/geopattern-icon/google-plus-one-button.svg)
 * [Google Plus One Button](https://wordpress.org/plugins/google-plus-one-button/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/google-plus-one-button/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/google-plus-one-button/)
 * [Active Topics](https://wordpress.org/support/plugin/google-plus-one-button/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/google-plus-one-button/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/google-plus-one-button/reviews/)

 * 10 replies
 * 8 participants
 * Last reply from: [Frank Leigh](https://wordpress.org/support/users/frank-leigh/)
 * Last activity: [14 years ago](https://wordpress.org/support/topic/1-button-w3c-validation/#post-2115330)
 * Status: not resolved