Web Analytics Made Easy -
StatCounter What's the difference? - CodingForum

Announcement

Collapse
No announcement yet.

What's the difference?

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • What's the difference?

    As a newbie i'm getting confused between to script starting tags.

    Mostly I have seen this script:
    <script language="JavaScript">

    but on some if have seen
    <script type="text/javascript">

    Could anyone please tell me what is the difference between using one or ther other.

    If they are for different uses what are they?

    Thanks

  • #2
    <script language="JavaScript"> is the old way to do it, deprecated in later HTML versions. <script type="text/javascript"> is the way you should do it in recent versions.
    liorean <[[email protected]]>
    Articles: RegEx evolt wsabstract , Named Arguments
    Useful Threads: JavaScript Docs & Refs, FAQ - HTML & CSS Docs, FAQ - XML Doc & Refs
    Moz: JavaScript DOM Interfaces MSDN: JScript DHTML KDE: KJS KHTML Opera: Standards

    Comment


    • #3
      just <script> works too, and in fact you can have both attributes too:
      <script type="text/javascript" language="JavaScript">

      I'm pretty sure, because I've seen that before too.

      I just use <script> since it gives me the ability to switch up vbScript and Javascript... maybe not a good thing, but I don't care too much.

      Sadiq.

      Comment

      Working...
      X