Support » Plugin: Facebook » W3C Validation Error caused my empty 'src' tag generated by plugin.

  • Resolved pixelworx


    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 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,


Viewing 3 replies - 1 through 3 (of 3 total)
  • Plugin Author Niall Kennedy


    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.

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



    Plugin Author Niall Kennedy


    Patched in the next version of WordPress.

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘W3C Validation Error caused my empty 'src' tag generated by plugin.’ is closed to new replies.