Rocketloader causing W3C-errors

I just realised that, when rocketloader is switched on the W3C-validator is showing errors:
In my source code I have the tag . Rocketloader is adding an argument “type” into this tag. The W3C-validator then complains “bad value for attribute type …”: “subtype missing”.
As soon as I switch off rocketloader everything is ok again.
Any ideas how to resolve this?

Hi @user387,

Rocket Loader rewrites the HTML script tags so that it can defer the loading of them to optimise rendering performance. As such the “type” of the script tag will not be “javascript” temporarily until Rocket Loader executes and loads everything in the background.

This might be what W3C is seeing but in itself it should not be anything to worry about. Can you let me know a URL so I can check?

This topic was automatically closed after 14 days. New replies are no longer allowed.

Continuing the discussion from Rocketloader causing W3C-errors:
Sorry that I had to reopen this topic, but I was out for a while and couldn’t answer.
@simon: Of course, I did not notice any direct problems with our pages, but both our SEO software and the W3C validator complained when rocketloader was switched on. If they do so, I fear that search engine robots might do so, too, resulting in a downgrade in the page ranking. For us that was not worth a few milliseconds of faster loading, so we switched off the rocketloader.
The site is www.maennerscheidung.info

@user387 I think this is the problem here:

    <!-- JS Scripts-->
    <!-- jQuery Js -->
    <script src="assets/js/jquery-1.10.2.js"></script>
      <!-- Bootstrap Js -->
    <script src="assets/js/bootstrap.min.js"></script>
  	 
    <!-- Metis Menu Js -->
    <script src="assets/js/jquery.metisMenu.js"></script>
    <!-- Custom Js -->
    <script src="assets/js/custom-scripts.js"></script>

Can I ask you to add type="text/javascript" to each of these like so:

    <!-- JS Scripts-->
    <!-- jQuery Js -->
    <script src="assets/js/jquery-1.10.2.js" type="text/javascript"></script>
      <!-- Bootstrap Js -->
    <script src="assets/js/bootstrap.min.js" type="text/javascript"></script>
  	 
    <!-- Metis Menu Js -->
    <script src="assets/js/jquery.metisMenu.js" type="text/javascript"></script>
    <!-- Custom Js -->
    <script src="assets/js/custom-scripts.js" type="text/javascript"></script>

Then try re-enabling Rocket Loader and running the validation check again? Defining your script types properly should ensure we don’t replace the type attribute with something invalid. We are also going to improve Rocket Loader so this doesn’t happen, but this is the fix for now.

Dear Simon,

thx for your efforts. I now had the time to change the js-section of my
code as you suggested.
However, the w3c-validator is still complaining: no longer with an
error, but now with the warning “the type attribute is unnecessary for
javascript resources”, so I prefer to keep the old source code and keep
rocketloader switched off.

Regards
Georg

Hi Georg,

OK - just so you this type of warning can be safely ignored here, but we’ll be changing the way Rocket Loader rewrites script tags with missing type attributes and I’ll let you know when this is complete.

@user387 just wanted to let you know this fix is now live - so you shouldn’t see any issues with the W3C validator and changes Rocket Loader is making to your HTML.