#1
  1. No Profile Picture
    Registered User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Apr 2013
    Posts
    1
    Rep Power
    0

    How to defer parsing JavaScript (in an XHTML page)?


    I was add defer to code but it is not validation.
    Code:
    <script src=" http://example.com/ demo_defer.js" defer> </script>
    My site: http://trihung.com

    Anyone help me, please ?
  2. #2
  3. CSS & JS/DOM Adept
    Devshed Supreme Being (6500+ posts)

    Join Date
    Jul 2004
    Location
    USA (verifiably)
    Posts
    20,127
    Rep Power
    4304
    Welcome to DevShed Forums, trihungpc.

    XHTML requires that all attributes have a value. In the case of "boolean attributes", you simply set the value to the name of the attribute:
    Code:
    <script src="http://example.com/demo_defer.js" defer="defer"></script>
    By the way, you may not be aware that text/html should not be used with XHTML 1.1; use application/xhtml+xml instead or switch to XHTML 1.0 Strict or HTML5. IE versions before 9 don't support application/xhtml+xml. Simply changing the <meta> element does not work. This needs to be sent in the actual HTTP Response Header.
    Sending XHTML as text/html Considered Harmful
    Serving up XHTML with the correct MIME type
    http://www.w3.org/2003/01/xhtml-mimetype/
    http://www.xml.com/pub/a/2003/03/19/dive-into-xml.html
    http://www.w3.org/TR/xhtml-media-typ...tion-xhtml-xml
    Content-Typing XHTML

    Does your site actually use RDFa? I don't see any of it in the home page's XHTML.
    Spreading knowledge, one newbie at a time.

    Check out my blog. | Learn CSS. | PHP includes | X/HTML Validator | CSS validator | Common CSS Mistakes | Common JS Mistakes

    Remember people spend most of their time on other people's sites (so don't violate web design conventions).
  4. #3
  5. No Profile Picture
    Registered User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Aug 2014
    Posts
    1
    Rep Power
    0
    Originally Posted by trihungpc
    I was add defer to code but it is not validation.
    Code:
    <script src=" http://example.com/ demo_defer.js" defer> </script>
    My site: Trihung.com:

    Anyone help me, please ?
    Thank

IMN logo majestic logo threadwatch logo seochat tools logo