• Resolved newbiedev

    (@newbiedev)


    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:

    1. 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>
    1. 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
    2. 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=''></scri

    The page I need help with: [log in to see the link]

Viewing 4 replies - 1 through 4 (of 4 total)
  • Plugin Author Optimizing Matters

    (@optimizingmatters)

    not sure what is happening, but this clearly is not default behavior as AO will only try to aggregate _local_ javascript while leaving 3rd party sources in place (such as anything but not limited to hosted on https://static.addtoany.com/) as AO simply can’t fetch such files from the filesystem.

    so the question now is; what is interfering with AO’s standard behavior and how?

    Thread Starter newbiedev

    (@newbiedev)

    I’ve tried disabling every other plugin and see if its due to that. But It seems this behavior is happening from Autoptimize plugin only. If I disable the plugin or disable the Exclude scripts from Autoptimize option, the JS urls seem to appear.

    Could you suggest what to do to identify and fix the issue?

    Plugin Author Optimizing Matters

    (@optimizingmatters)

    I just installed a2a on one of my test-sites with “aggregate JS” on, but I can’t reproduce the issue I’m afraid newbiedev.

    But (there’s always a but) upon investigation of the HTML source of your site, I do see static.addtoany.com mentioned in your theme’s JavaScript (see below) so you’ll probably have to change theme settings somewhere for it not to touch addtoany JS?

    <script>var jnewsoption = jnewsoption || {}; jnewsoption.au_scripts = [{"url":"https:\/\/static.addtoany.com\/menu\/page.js","defer":true},{"url":"\/\/cdn.intergient.com\/ramp.js","defer":true},{"url":"https:\/\/cdn.unibotscdn.com\/player\/mvp\/player.js","defer":true},{"url":"https:\/\/securepubads.g.doubleclick.net\/tag\/js\/gpt.js","defer":true},{"url":"https:\/\/www.iforher.com\/wp-content\/plugins\/autoptimize\/classes\/external\/js\/lazysizes.min.js","defer":true},{"url":"https:\/\/www.iforher.com\/wp-content\/cache\/autoptimize\/js\/autoptimize_8dd427830036db1df7fc76fcfe83b6c4.js","defer":true}];</script>

    Plugin Author Optimizing Matters

    (@optimizingmatters)

    No feedback so I assume this got resolved by changing theme settings? Feel free to follow up if you still encounter issues!

    have a nice day!
    frank

Viewing 4 replies - 1 through 4 (of 4 total)
  • You must be logged in to reply to this topic.