• Resolved shivaji

    (@shivaji)


    https://validator.w3.org/ throws these warnings:

    The type attribute for the style element is not needed and should be omitted.
    The type attribute is unnecessary for JavaScript resources.

    <script type=”text/javascript” src=”/wp-content/plugins/smart-slider-3/Public/SmartSlider3/Application/Frontend/Assets/dist/n2.min.js?ver=a96b01e9″>

    <style type=”text/css”>.n2-ss-spinner-simple-white-container {
    position: absolute;
    top: 50%;
    left: 50%;
    margin: -20px;
    background: #fff;
    width: 20px;
    height: 20px;
    padding: 10px;
    border-radius: 50%;
    z-index: 1000;
    }

    Any idea how to fix it? I have added some functionality to remove the type from script and style and it is working fine except it is not working for your plugin.

    // remove type attribute enqueue
    add_filter(‘style_loader_tag’, ‘puddinq_remove_type_attr’, 10, 2);
    add_filter(‘script_loader_tag’, ‘puddinq_remove_type_attr’, 10, 2);

    function puddinq_remove_type_attr($tag, $handle) {
    return preg_replace( “/type=[‘\”]text\/(javascript|css)[‘\”]/”, ”, $tag );
    }

    NOTE:
    In the global settings> I have selected Inline at HEAD for both CSS and JS.

    • This topic was modified 4 years ago by shivaji.
    • This topic was modified 4 years ago by shivaji.
Viewing 8 replies - 1 through 8 (of 8 total)
  • Ramona

    (@nextend_ramona)

    Hi @shivaji

    Thanks for the report!

    These warning shouldn’t actually cause any problems, but we’ll remove them in the next Smart Slider 3 release.

    Thread Starter shivaji

    (@shivaji)

    Thank you very much for such a quick response. I am expecting this release to happen quickly. Looking forward to it.

    Thread Starter shivaji

    (@shivaji)

    Any timeframe for this implementation? When the next realease will come?

    Ramona

    (@nextend_ramona)

    Hi @shivaji

    Currently we don’t have any ETA for this release.

    But I uploaded the installer here for you where we removed the type attribute from our script tag:
    https://www.dropbox.com/s/2al9cg4gi16ct6z/smart-slider3-wordpress-free-master.zip?dl=1
    You can install it by performing an alternative update:
    https://smartslider.helpscoutdocs.com/article/1752-update#alternative-wp

    Note:
    We’ve only removed the type attribute from the script tag, because the release after this one will remove this style tag completely:
    <style type="text/css">.n2-ss-spinner-simple-white-container {
    So for this patch we haven’t modified this style tag, as it will be removed soon.

    Thread Starter shivaji

    (@shivaji)

    Yes, it removed all <script> type attributes but <style> type attributes remains. Please remove this too in next release.

    Thanks.

    Thread Starter shivaji

    (@shivaji)

    Hello @nextend_ramona. any update for the Style tag removal? It is basically not needed.

    Ramona

    (@nextend_ramona)

    Hi @shivaji

    The next major release will remove the <style type="text/css">.n2-ss-spinner-simple-white-container { tag completely.
    (This tag connected to the Loading animation, which will be completely removed due to the speed improvements the next version will bring.)

    This next version is still under development, and I’m sorry but I don’t have any ETA about its release yet.

    Having the type attribute does not actually cause any errors on your site. Some HTML validators might throw warnings, that you could remove these tags, but having them doesn’t cause any display or usability problems on your site.

    Thread Starter shivaji

    (@shivaji)

    yes, sometimes people wanted to see that the site consists of 0 errors in the HTML validator so the need arises otherwise type doesn’t matter much.

    I will be looking forward to the next major release.

    Thanks.

Viewing 8 replies - 1 through 8 (of 8 total)
  • The topic ‘W3C Validator Error for type attribute’ is closed to new replies.