Empty JS urls in Script tags
-
Hi Team
I’m getting below errors in w3 html validator.
So far I’ve understood the below reason for these errors:
Taking one Example:- This is the url of JS which is getting removed from the script tag: https://static.addtoany.com/menu/page.js
<script type="text/javascript" async src="" id="addtoany-core-js"></script>
- This is happenining because Autoptimize plugin is aggregating JS files when I’ve enabled this option: Aggregate all linked JS-files to have them loaded non-render blocking
- When I check by disabling this option in autoptimize the errors go away.
Now what i can understand is autoptimize is removing the JS file url from the script tag, but it is not removing the entire script tag.
I’ve tried one approach where if I add this js to “Exclude scripts from Autoptimize”, the error is resolved for that particular JS. But this would mean I’m trading off optimizing this particular JS file.
Can you suggest what is the best approach to solve this issue?
List of all errors due to this issue
Error: Bad value for attribute src on element script: Must be non-empty.
From line 3, column 20359; to line 3, column 20426
</script> <script type="text/javascript" async src="" id="addtoany-core-js"></scri
------------
Error: Bad value for attribute src on element script: Must be non-empty.
From line 5, column 18406; to line 5, column 18426
}</style> <script async src=""></scri
------------
Error: Bad value for attribute src on element script: Must be non-empty.
From line 5, column 18437; to line 5, column 18457
</script> <script async src=""></scri
------------
Error: Bad value for attribute src on element script: Must be non-empty.
From line 6, column 49518; to line 6, column 49557
;</script><script async data-noptimize="1" src=''></scriThe page I need help with: [log in to see the link]
Viewing 4 replies - 1 through 4 (of 4 total)
Viewing 4 replies - 1 through 4 (of 4 total)
- You must be logged in to reply to this topic.