473,761 Members | 7,351 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

<script language="javas cript" ..is correct in xhtml?

Just found a funny things..

in HTML4's dtd, http://www.w3.org/TR/html4/strict.dtd

language is not valid, i.e.

<!ELEMENT SCRIPT - - %Script; -- script statements -->
<!ATTLIST SCRIPT
charset %Charset; #IMPLIED -- char encoding of linked
resource --
type %ContentType; #REQUIRED -- content type of script
language --
src %URI; #IMPLIED -- URI for an external script
--
defer (defer) #IMPLIED -- UA may defer execution of
script --
event CDATA #IMPLIED -- reserved for possible future
use --
for %URI; #IMPLIED -- reserved for possible future
use --
>
But in XHTML, language is valid (although type is still required)
http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd

<!ELEMENT script (#PCDATA)>
<!ATTLIST script
id ID #IMPLIED
charset %Charset; #IMPLIED
type %ContentType; #REQUIRED
language CDATA #IMPLIED
src %URI; #IMPLIED
defer (defer) #IMPLIED
xml:space (preserve) #FIXED 'preserve'
>
Howard.

Jun 27 '08 #1
8 5067
howa wrote:
Just found a funny things..

in HTML4's dtd, http://www.w3.org/TR/html4/strict.dtd

language is not valid, i.e.
You're comparing apples and oranges: strict and transitional.
Jun 27 '08 #2
On Jun 5, 1:19 am, C A Upsdell <cupsd...@upsde ll.invalidwrote :
howa wrote:
Just found a funny things..
in HTML4's dtd,http://www.w3.org/TR/html4/strict.dtd
language is not valid, i.e.

You're comparing apples and oranges: strict and transitional.
Oh...I have misread that!

So change the topic:

Why language is allowed in transitional, but not strict ?
Howard
Jun 27 '08 #3
On Wed, 04 Jun 2008 19:31:34 +0200, howa <ho******@gmail .comwrote:
On Jun 5, 1:19 am, C A Upsdell <cupsd...@upsde ll.invalidwrote :
>howa wrote:
Just found a funny things..
in HTML4's dtd,http://www.w3.org/TR/html4/strict.dtd
language is not valid, i.e.

You're comparing apples and oranges: strict and transitional.

Oh...I have misread that!

So change the topic:

Why language is allowed in transitional, but not strict ?
Because it's deprecated, so it will be in many old documents, and while
TRANSITIONING to a new DTD/version, it can be many of them are still not
'caught'/altered. The moment of complete compliance, as soon as you're
done transitioning, you also have replaced all the language attributes
with type-attributes, and you can use STRICT. Using transitional for html
not transitioning is just silly...
--
Rik Wasmus
....spamrun finished
Jun 27 '08 #4
Hi
Because it's deprecated, so it will be in many old documents, and while
TRANSITIONING to a new DTD/version, it can be many of them are still not
'caught'/altered. The moment of complete compliance, as soon as you're
done transitioning, you also have replaced all the language attributes
with type-attributes, and you can use STRICT. Using transitional for html
not transitioning is just silly...
--
Rik Wasmus
...spamrun finished
Interesting questions would be

1. Who created it? Why removed finally?
2. `type` is required even at HTML4 dtd, why people are only using
`language`? (Due to incorrect implementation of Dreamweaver /
Frontpage for example?)

Howard
Jun 27 '08 #5
howa wrote:
>Because it's deprecated, so it will be in many old documents, and while
TRANSITIONIN G to a new DTD/version, it can be many of them are still not
'caught'/altered. The moment of complete compliance, as soon as you're
done transitioning, you also have replaced all the language attributes
with type-attributes, and you can use STRICT. Using transitional for html
not transitioning is just silly...
--
Rik Wasmus
...spamrun finished

Interesting questions would be

1. Who created it? Why removed finally?
2. `type` is required even at HTML4 dtd, why people are only using
`language`? (Due to incorrect implementation of Dreamweaver /
Frontpage for example?)
Netscape 4 did not support TYPE, so LANGUAGE had to be used until
Netscape 4 became extinct, and even when it had become extinct, many
people continued to use LANGUAGE, perhaps out of habit.

Jun 27 '08 #6
Scripsit C A Upsdell:
Netscape 4 did not support TYPE, so LANGUAGE had to be used until
Netscape 4 became extinct
Since Netscape only supported JavaScript as the scripting language, no
attribute was needed to tell it that the language is JavaScript.

The LANGUAGE attribute was introduced by Netscape to indicate JavaScript
_version_, and if you wish to do that, you still need that attribute,
since the TYPE attribute does not allow that. (More exactly, the
Internet media types for JavaScript do not allow any version to be
specified.)

It was (and still is) possible to write e.g. one SCRIPT element with
LANGUAGE="JavaS cript1.2" and another one with LANGUAGE="JavaS cript1.3"
so that a browser that only supports JavaScript 1.2 ignores the latter.
This was never a particularly good idea, but that's the story behind
LANGUAGE.

In practice, neither TYPE nor LANGUAGE is needed, since browsers assume
by default that the language is JavaScript. But if you do specify one of
those attributes and with a _wrong_ (e.g., misspelled) value, your
script may well be ignored.

--
Jukka K. Korpela ("Yucca")
http://www.cs.tut.fi/~jkorpela/

Jun 27 '08 #7
On 6$B7n(B5$BF| (B, $B2<8a(B1$B; ~(B21$BJ,(B, C A Upsdell <cupsd...@upsde ll.invalidwrote :
howa wrote:

Netscape 4 did not support TYPE, so LANGUAGE had to be used until
Netscape 4 became extinct, and even when it had become extinct, many
people continued to use LANGUAGE, perhaps out of habit.
Definitely a bad habit, even Mozilla don't use LANGUAGE in their web
site now.

Howard
Jun 27 '08 #8
Jukka K. Korpela wrote:
Scripsit C A Upsdell:
>Netscape 4 did not support TYPE, so LANGUAGE had to be used until
Netscape 4 became extinct

Since Netscape only supported JavaScript as the scripting language, no
attribute was needed to tell it that the language is JavaScript.
It was actually more complex than that. Netscape 4 was rife with bugs,
some of which appeared in most (or all) versions of Netscape 4, and some
of which appeared only in certain versions. And one of the bugs was
that, when the LANGUAGE attribute was not specified, Netscape would
*sometimes* parse the HTML improperly.

I never did figure out all the factors which led Netscape 4 to misbehave
-- there were SO many -- but I did discover some common factors, and I
developed defensive design techniques which minimized the problems. One
defensive technique was to always include the LANGUAGE attributes. No
doubt there were many cases where it did not matter, but designing
defensively minimized the instances when it did, saving me much time.
Jun 27 '08 #9

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

6
11797
by: John Davis | last post by:
Just wonder if <%@ Language="JAVASCRIPT" %> exists?? Since JavaScript is used in client-side scripting, but <% ... %> is used in server-side scripting. It sounds doesn't make sense. But I saw that in a ASP test question before. The question is like this: How can you script your ASP code in JavaScript? The answer is: <%@ Language="JAVASCRIPT" %>
2
5456
by: Amir | last post by:
What the for="window" is used for in the <script> tag? TIA
9
13426
by: David D. | last post by:
Does the file extension matter when including a JavaScript file in an HTML page? Normally, one would include a JavaScript file in an HTML page using <script src="foo.JS" type="text/javascript"> However, I have found that I can use an alternate file extension, such as <script src="foo.HTML" type="text/javascript"> It works fine with my IE 6 and Mozilla. Will it work with other browsers?
23
16143
by: Loony | last post by:
I have got a code like this in HTML section in ASP file which includes javascript file! The script works under MS IE but doesn't with Firefox! Can anybody tell me what is wrong? <HTML> <HEAD><TITLE></TITLE> <SCRIPT LANGUAGE="JavaScript" SRC="../inc/JSfile.js"><SCRIPT> <SCRIPT> <!-- other javascript scripts working propely
0
2559
by: Joeyej | last post by:
Hi - I'm trying to move/use a web form (containing some javascript field checks) previously hosted on a Windows 2000 server. However, the FORM METHOD="post..." command in the form (shown below) now renders "Page not Found" when launched on the new Windows 2003 server (ws-server1). The form is designed to use the write.asp program to write to an Acccess database and is successful on any Windows 2000 server. This is frustrating because...
9
4411
by: Steve | last post by:
Hi; I've being going through some legacy code on an old JSP site I have been patching. I noticed that when I save the JSP down to my PC as an HTML file I get this javascript error in IE 6 ( not in the latest Firefox ): "invalid character" The problem traces back to this line of code:
0
9522
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
10111
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
9948
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
0
8770
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
7327
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
6603
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
1
3866
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
3
3446
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2738
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.