So I've been playing with Google's +1 button trying to get it on my website, but it's not W3C compliant.
Here's the code:
<!-- Place this tag in your head or just before your close body tag -->
<script type="text/javascript" src="http://apis.google.com/js/plusone.js">
{lang: 'en-GB'}
</script>
<!-- Place this tag where you want the +1 button to render -->
<g:plusone size="medium" href="http://www.example.org"></g:plusone>
Does anyone know why this happens and how to make this compliant? Thanks
EDIT: To get this to pass through the validation, I wrote an article on my website.
{lang: 'en-GB'}
part looks weird to me. Firstly because the same script tag is loading fromsrc
, so I don't think there should be any more code in it. Secondly, the object literal is not assigned to anything, so what's the point of it? – Flotow{lang: 'en-GB'}
portion in the above) and act on it. It's a convenient pattern for bundling a JS object literal that a script can use as parameters or configuration, etc. Just FYI ... – Indignant