473,406 Members | 2,745 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,406 software developers and data experts.

type attribute in the script element

I just went across Douglas Crockford's website, and in this page, he
mentions that the type/language attribute is not needed, since it is
the server that determines the MIME type. But according to W3C
document, the type attribute is required and language attribute has
been deprecated.

So I guess the type attribute can be omitted to reduce the file size a
little bit, but in order to be validated, this shouldn't be omitted.

Mar 13 '07 #1
4 1188
On Mar 13, 4:17 pm, "jackcha...@gmail.com" <jackcha...@gmail.com>
wrote:
I just went across Douglas Crockford's website, and in this page, he
mentions that the type/language attribute is not needed, since it is
the server that determines the MIME type. But according to W3C
document, the type attribute is required and language attribute has
been deprecated.

So I guess the type attribute can be omitted to reduce the file size a
little bit, but in order to be validated, this shouldn't be omitted.
sorry to include the links

here are the links:
http://javascript.crockford.com/code.html

http://www.w3.org/TR/html4/interact/scripts.html

Mar 13 '07 #2
ja********@gmail.com wrote:
I just went across Douglas Crockford's website, and in this page, he
mentions that the type/language attribute is not needed, since it is
the server that determines the MIME type.
In a theoretical version of HTML that doesn't exist - that is true. You
don't need to tell the browser what to expect, it can be surprised when it
makes the request.

On the other hand, if you tell the browser what to expect, it doesn't need
to make the request if it doesn't recognise the type - and the HTML spec
requires you do this.

--
David Dorward <http://blog.dorward.me.uk/ <http://dorward.me.uk/>
Home is where the ~/.bashrc is
Mar 13 '07 #3
On Mar 14, 9:17 am, "jackcha...@gmail.com" <jackcha...@gmail.com>
wrote:
I just went across Douglas Crockford's website, and in this page, he
mentions that the type/language attribute is not needed, since it is
the server that determines the MIME type. But according to W3C
document, the type attribute is required and language attribute has
been deprecated.

So I guess the type attribute can be omitted to reduce the file size a
little bit, but in order to be validated, this shouldn't be omitted.
You should find an answer in this thread:

<URL:
http://groups.google.com.au/group/co...ef46cb24e69a22
>
--
Rob

Mar 14 '07 #4
In comp.lang.javascript message <11**********************@e65g2000hsc.go
oglegroups.com>, Tue, 13 Mar 2007 16:20:34, "ja********@gmail.com"
<ja********@gmail.composted:
>On Mar 13, 4:17 pm, "jackcha...@gmail.com" <jackcha...@gmail.com>
wrote:
>I just went across Douglas Crockford's website, and in this page, he
mentions that the type/language attribute is not needed, since it is
the server that determines the MIME type. But according to W3C
document, the type attribute is required and language attribute has
been deprecated.

So I guess the type attribute can be omitted to reduce the file size a
little bit, but in order to be validated, this shouldn't be omitted.

Without that attribute, how do you expect a page that uses mainly
VBscript to recognise that a particular script section is Jscript ?

DC is referring only to included *.js files in that section.
>sorry to include the links

here are the links:
http://javascript.crockford.com/code.html

Some of its requirements conflict with what is agreed appropriate for
code posted here. Here, line-length should where possible be limited to
72 characters, and two (or three) spaces are considered an adequate
indent unit.

Its author is presumably an American, since he uses "international" to
exclude Anglo-American characters; the shorter word "other" could have
been used in the context.

It's a good idea to read the newsgroup and its FAQ. See below.

--
(c) John Stockton, Surrey, UK. ?@merlyn.demon.co.uk Turnpike v6.05 IE 6
news:comp.lang.javascript FAQ <URL:http://www.jibbering.com/faq/index.html>.
<URL:http://www.merlyn.demon.co.uk/js-index.htmjscr maths, dates, sources.
<URL:http://www.merlyn.demon.co.uk/TP/BP/Delphi/jscr/&c, FAQ items, links.
Mar 14 '07 #5

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

Similar topics

6
by: Boyd Reilly | last post by:
I have a form that has the user pick the type of question he will answer. The input field will be a text, numeric or date type. So, after the question is answered, I need to change the input...
7
by: Erwin Moller | last post by:
Hi group, I am a bit cconfused with the different tags I encounter to start a script. I used to use: language="Javascript" Nowadays I use: type="text/javascript" I did see some...
31
by: xah | last post by:
what's the pro and con of using <script language="javascript"> vs <script type="text/javascript"> Xah xah@xahlee.org ∑ http://xahlee.org/
2
by: Jason Cartwright | last post by:
I have an abstract base class and two derived classes that I want to serialize and deserialize with schema validation. When I serialize instances of the derived classes the XmlSerializer adds the...
2
pradeepjain
by: pradeepjain | last post by:
<script src="getimages.php"></script> i am using this to run a script but dring validation it gives error as " Line 285, Column 51: required attribute "type" not specified. <div...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
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,...
0
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...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
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,...

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.