474,042 Members | 2,507 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

script type application or text ???

two possibilities or the attribute type of script :

text/javascript (the one i usually use)
application/x-javascript

what are the differencies between both ?

depends on the html content ?

for example html 4.0.1 versus xhtml 1.1 ???

--
Une Bévue
Feb 19 '07
12 5295
VK
Do you have some sort of difficulty in grasping the concept of doing
something differently IN THE FUTURE? Not now. Not the immediate future. Not
soon. Not until support is there.
"In those days came John the Baptist, preaching in the wilderness of
Judaea,
And saying, Repent ye: for the kingdom of heaven is at hand."

OK, I'm grasping this concept. But who the hell Bjoern Hoehrmann is to
make the whole Internet community to follow and to obsolete 8 years of
practice as "praying to wrong gods"? I may grasp the concept that back
in 2001 he had a vision on the wall: "Behold and perceive: there is no
type but application/javascript". I may also grasp that ever since he
was harassing IETF with I-Ds (expiring every year by protocol) until
finally they gave up on RFC for him. I'm still not grasping though why
a desire of a single person should override everything. I have nothing
against of Bjoern Hoehrmann personally - shall be health and
prosperity on him. But technically he did not invent anything publicly
useful for a normal RFC like "here is the new stuff, if you like it
then better to use it in this way". Instead he just came to say that
"all what you were doing is wrong, here is the right way to do it
because I'm saying so". And as no one can find his name in the book,
anyone is in right to ask this simple question: "Who the hell you are,
Mr. Hoehrmann?"

Yes, historically type="text/javascript" has nothing to do neither
with Content-Type response header nor with <scriptelemen t. It was
introduced in Netscape 4.0 for <styleattribu te together with the
proposed dual CSS structure. It is out of use for many years by now so
I'm reminding that in Netscape 4.x one could use two syntax for style
rules:
1) the regular (now) CSS syntax:
<style type="text/css">
a {
font-weight: "bold";
text-decoration: "none";
}
</style>

2) JavaScript-like syntax:
<style type="text/javascript">
tags.A.fontWeig ht="bold";
tags.A.textDeco ration="none";
</style>

It had nothing to do with <scriptwhere "language" attribute remained
with important distinction of values "JavaScript " and "JavaScript1.2" .
It had nothing to do neither with Content-Type of any kind: "type"
attribute was of the same kind as "type" in form controls. The second
syntax did not fly and it was not in extensive use even during the
Browser Wars. The reason is the same as in many other Netscape 4.x
troubles: inability to manipulate style rules at runtime. In either
case it was applied once and forever on page load. The idea itself of
using script capabilities in style rules was good: Microsoft
implemented it later in IE5 using expressions. There are still content
generating libraries in use with dual CSS support for Netscape 4.0
inside. Because careless admins did not go away neither :-) from time
to time one may notice strange types on served pages like <style
type="text/javascript"The most "sound" from recent ones is Google
front page last year. That's getting OT though...

Anyway, when W3C were preparing HTML 4.0, they were on "typization "
campaign: each element has to be typed. In W3C everything seems go by
compain: "everything with type, everything in XML, everything has to
start with X in its name". :-)
"text/javascript" was not related with <scriptelemen t but i) it was
still related with JavaScript as such and ii) it was known to public.
So the choice was made for <script type="text/javascript"in the
final Recommendation. At the same time meaning transfer was made: it
was stated that element's "type" attribute corresponds to Content-Type
response header - which it never did neither before nor after.

As of now - year 2007 - things are as they are, and who cares what did
something mean to ancestors? For us it means that and we are reading
it in this way. Good enough.

Feb 22 '07 #11
On 22 Feb 2007 10:48:12 -0800, "VK" <sc**********@y ahoo.comwrote:
>. And as no one can find his name in the book,
anyone is in right to ask this simple question: "Who the hell you are,
Mr. Hoehrmann?"
He's quite easy to find, and whilst somewhat elusive to meet in
person, I've bought him a beer...

I think you're confusing the registration of javascript mime-types as
some how related to HTML, it's not, it's to make sure that the HTML
mess doesn't continue with other uses...

Jim.
Feb 23 '07 #12
VK
. And as no one can find his name in the book,
anyone is in right to ask this simple question: "Who the hell you are,
Mr. Hoehrmann?"


He's quite easy to find, and whilst somewhat elusive to meet in
person, I've bought him a beer...
I might buy him whisky - Bay Area's bud'-water can be taken as an
insult rather than a friendly gesture :-)
As I stated before it is not a personal attack but a technical need
question.
I think you're confusing the registration of javascript mime-types as
some how related to HTML, it's not, it's to make sure that the HTML
mess doesn't continue with other uses...
It is now all related: type attribute, MIME string and Content-Type -
because of the decision made back in April 1998 by W3C to announce
type attribute as Content-Type representation.
To separate the issues first one has to announce type attribute and
Content-Type as two unrelated chunk of information. I see neither
technical possibility nor any visible need to enforce it almost eight
years later Web-wide.

The treatement of external javascript sources is well established and
supported by all existing UAs. It is context based with strong
distinction of contextual request and context-free request.

1. contextual request happens from HTML page while resolving script
src. In such case Content-Type for resource is irrelevant and
disregarded. The response is treated as CDATA text stream which is
either parsed or leads to syntax error.

2. context-free request happens then you directly type in javascript
file URL into address bar. In this case Content-Type has the regular
effect (known-unknown, display-prompt, safe-unsafe).

There is no confusion in the current system AFAICT But it may be a
huge one because of the time-endorsed association "type attribute ==
Content-Type" and the need to keep "text/javascript" support for N
amount of time even if everyone jumps on application/javascript right
now. I expressed some of my doubts once at
<http://groups.google.com/group/mozil...ne/browse_frm/
thread/93f705444dd4acc 5>

Feb 23 '07 #13

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

Similar topics

2
14754
by: Ralf Schneider | last post by:
Hi there, can anybody help me? It won't work! Why? My declaration: <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en"> <head>
6
6121
by: nate | last post by:
Hello, Does anyone know where I can find an ASP server side script written in JavaScript to parse text fields from a form method='POST' using enctype='multipart/form-data'? I'd also like it to parse the filename. <form name='form1' method='POST' enctype='multipart/form-data' action='sub.asp'> <input type='text' name='title1' value='value1'> <input type='file' name='file1'>
4
1840
by: Semi Head | last post by:
Hello folks, I'm looking for a script to validate a specific number value in a standard form input field. An example would be, if someone enters a number into a form input, I want the script to validate it and give an alert if that the number exceeds the set script value. Like if the script value is set for 3000 and the number 3002 is entered, I want an alert to pop and give a warning, BTW - This script must be generic enough to work...
44
2893
by: rhythmace | last post by:
W3C HTML validator passes this: .... <script type="text/javascript" src="foo.js"> <script type="text/javascript"> ....script in here... </script> ....
19
3847
by: thisis | last post by:
Hi All, i have this.asp page: <script type="text/vbscript"> Function myFunc(val1ok, val2ok) ' do something ok myFunc = " return something ok" End Function </script>
2
1628
Mr aldo
by: Mr aldo | last post by:
Hello I have this Sendmail Script here that uses Javascript, so when a field is left empty it makes a pop up saying a field was left empty and you click OK but when you click OK it proccesses it and sends the email and I of course do want that done. Here is the code: <html> <head> <script> function doSubmit() { if (validateOne() == false) { alert("Forum username is required for application submission!"); return;
9
4434
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:
3
5212
by: aRTx | last post by:
I have try a couple of time but does not work for me My files everytime are sortet by NAME. I want to Sort my files by Date-desc. Can anyone help me to do it? The Script <? /* ORIGJINALI
1
47565
KevinADC
by: KevinADC | last post by:
Note: You may skip to the end of the article if all you want is the perl code. Introduction Many websites have a form or a link you can use to download a file. You click a form button or click on a link and after a moment or two a file download dialog box pops-up in your web browser and prompts you for some instructions, such as “open” or “save“. I’m going to show you how to do that using a perl script. What You Need Any recent...
0
10335
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
12131
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
10303
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
8689
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
7862
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();...
0
6827
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
5405
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
2
4937
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
3964
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.