Reputation: 1290
I've got problem with my website "http://szymondziewonski.com/" , I want to load google plus button with
<script type="text/javascript" src="https://apis.google.com/js/plusone.js">
{
parsetags: 'explicit';
}
</script>
And then, put this script in place which is loaded.
<script type="text/javascript">gapi.plusone.go(".googlePlusHomePage .special");</script>
It works good mostly someitimes i get error in developers tool, console.
Uncaught TypeError: Cannot read property 'src' of null
So that error is my first problem problem
And second problem is wc3 validate
The text content of element script was not in the required format: Expected space, tab, newline, or slash but found { instead.
Syntax of script documentation: Zero or more code comments, each of which is either a single-line comment starting with "//" or a multi-line comment starting with "/" and ending with "/". The content must also meet the constraints of the script microsyntax. For further details, see Inline documentation for external scripts
So, some1 know how to work around that? only with google button there is so much problems. Please help
Upvotes: 1
Views: 470
Reputation: 47833
You have a ;
at the end of your parsetags
line. That should be removed to look like this.
<script type="text/javascript" src="https://apis.google.com/js/platform.js">
{parsetags: 'explicit'}
</script>
I have not tested it but you might be able to set parsetags to explicit like this and avoid the validation error:
<script>
window.___gcfg = {
parsetags: 'explicit'
}
</script>
<script type="text/javascript" src="https://apis.google.com/js/platform.js"></script>
Upvotes: 1