Blogger Tip: JavaScript Import Error - "Attribute name "async" associated with an element type “script” must be followed by the ‘ = ‘ character." - This error also occurs for "defer".
Error parsing XML, line 9, column 16: Attribute name "async" associated with an element type "script" must be followed by the ' = ' character.
This blog is built using Blogger. On the left side of the blog, you'll notice the LinkedIn Badge for my LinkedIn profile.
This was pretty easy to add to the site, but I did run into a problem. Part of the setup process required me to add a new JavaScript import to the Blogger template. The JavaScript import statement was provided by LinkedIn and was easily copied and pasted into the
<head>
tag of the Blogger template. After clicking "Save theme" the error shown at the top of this post appeared.
After a little bit of research, the import tag was very easily fixed.
Before:
<script async defer src='//platform.linkedin.com/badges/js/profile.js' type='text/javascript'/>
After:
<script async='async' defer='defer' src='//platform.linkedin.com/badges/js/profile.js' type='text/javascript'/>
As you can see, I changed
async
to async='async'
. I also changed defer
to defer='defer'
.
This small change fixes the error and allows the JavaScript file to be imported without issue!
Was this helpful or have you run into other issues working with Blogger? Let me know in the comments below!