WordPress.org

Ready to get started?Download WordPress

Forums

Facebook
[resolved] W3C Validation Error caused my empty 'src' tag generated by plugin. (4 posts)

  1. pixelworx
    Member
    Posted 1 year ago #

    Hi! I've run into one small problem with the plugin, in that, when it is activated, I get a validation error with W3C for the line;

    <script type='text/javascript' src=''></script>

    which gives the error;

    Line 200, Column 38: Bad value for attribute src on element script: Must be non-empty.
    <script type='text/javascript' src=''></script>
    Syntax of IRI reference:
    Any URL. For example: /hello, #canvas, or http://example.org/. Characters should be represented in NFC and spaces should be escaped as %20.

    - caused, seemingly by the empty src tag in this line. Wee question, where is this line generated from (i.e. which plugin file) and why? It doesn't seem to do anything, does it?

    Can it be removed and the plugin still function correctly, or....?

    It's not a HUGE deal, but i'm trying to make sure all my code is clean and standard, so i'd very much like to solve this problem :)

    Thanks in advance,

    Joe

    http://wordpress.org/extend/plugins/facebook/

  2. Niall Kennedy
    Member
    Plugin Author

    Posted 1 year ago #

    The Facebook JavaScript SDK typically loads from an asynchronous snippet that allows the rendering of Facebook social plugins to get out of the way and become almost the last thing loaded on the page. WordPress prefers enqueued scripts, registering a handle and an associated script destination to prevent duplicate loading of scripts by other plugins and generally log resource loading. Some countries block Facebook, which could interfere with loading your page (or a similar effect if the script took a long time to retrieve from a server).

    The Facebook plugin for WordPress intercepts output of an enqueued script element, replacing a blocking script with a async loading snippet. A ticket was filed in WordPress Core to clear out the resulting empty src attribute.
    http://core.trac.wordpress.org/ticket/22470

  3. pixelworx
    Member
    Posted 1 year ago #

    Bingo! That change has solved it! Validating 100% as HTML5! Many thanks for your help! #genius

    Regards,

    Joe

  4. Niall Kennedy
    Member
    Plugin Author

    Posted 9 months ago #

    Patched in the next version of WordPress.
    http://core.trac.wordpress.org/changeset/25465

Topic Closed

This topic has been closed to new replies.

About this Plugin

About this Topic