Results 1 to 4 of 4

Thread: Type vs Language

  1. #1
    Join Date
    Jun 2008
    Posts
    40
    Thanks
    2
    Thanked 4 Times in 4 Posts

    Default Type vs Language

    Hey all,

    I was hoping for some help on a relatively simple question.

    When putting a script tag in, I often enter both 'type="text/javascript"' and 'language="javascript"'. Is one preferred to the other? Does one not matter?

    I appriciate any help.

  2. #2
    Join Date
    Feb 2008
    Location
    Cebu City Philippines
    Posts
    1,160
    Thanks
    17
    Thanked 277 Times in 275 Posts

    Default

    Use type="text/javascript". This is valid, while language is a deprecated attribute.

    It does'nt affect your script's performance though, but rather your page's validity.

    For further reading:
    http://www.w3.org/TR/html4/interact/...ml#edef-SCRIPT

    Hope it makes sense.
    Learn how to code at 02geek

    The more you learn, the more you'll realize there's much more to learn
    Ray.ph!

  3. #3
    Join Date
    Jun 2005
    Location
    英国
    Posts
    11,876
    Thanks
    1
    Thanked 180 Times in 172 Posts
    Blog Entries
    2

    Default

    The 'language' attribute is deprecated for 'type', as you would know if you had validated your page.
    Twey | I understand English | 日本語が分かります | mi jimpe fi le jbobau | mi esperanton komprenas | je comprends français | entiendo español | tôi ít hiểu tiếng Việt | ich verstehe ein bisschen Deutsch | beware XHTML | common coding mistakes | tutorials | various stuff | argh PHP!

  4. #4
    Join Date
    Sep 2005
    Location
    India
    Posts
    1,627
    Thanks
    6
    Thanked 107 Times in 107 Posts

    Default

    Here is a list of MIME type that can used with the "type" attribute value of script element.

    http://krijnhoetmer.nl/stuff/javascript/mime-types/

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •