Sonia
07-25-2003, 05:59 AM
Hi , I know this is a very stupid question but can anyone tell me the difference between <script language = "JavaScript"> and <script type = "text/JavaScript">
|
Click to See Complete Forum and Search --> : A very silly question Sonia 07-25-2003, 05:59 AM Hi , I know this is a very stupid question but can anyone tell me the difference between <script language = "JavaScript"> and <script type = "text/JavaScript"> Charles 07-25-2003, 06:12 AM It's not a silly question at all. There are several types of HTML that have been given to us by the merciful beneficence of the W3C. HTML 3.2 came out early in 1997 and was a description of how browsers worked at the time. HTML 4.0 came out later that year and described how browsers should work. (HTML 4.0 was in turn superseded by HTML 4.01 in 1999.) The "language" attribute was a part of the HTML 3.2 specification but it was depricated in 1997 and in favor of the "type" attribute. "Depricated" means that it was formally declared to have been a bad idea. Web authors are asked to stop using it and browsers are allowed to stop recognizing it. There were a couple of problems with the "language" attribute but the one that should convince you is that if you use it, even in conjunction with the "type" attribute, some versions of Netscape will behave in some non-standard ways. So, if you are using HTML 3.2, then you should use "language". If you are using HTML 4.01 the you should use "type". But you should be using HTML 4.01 anyway. (http://www.w3.org/TR/html4/) Sonia 07-25-2003, 01:00 PM So you want to say if I'm using HTML version 4.0, I should not be using the 'language' attribute?:confused: :confused: Charles 07-25-2003, 05:55 PM Do not use HTML 4.0, use HTML 4.01. HTML 3.2 - use the "language" attribute. HTML 4.01 - use the "type" attribute. webdeveloper.com
Copyright Internet.com Inc., All Rights Reserved. |