473,839 Members | 1,413 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 #1
12 5275
Une Bévue wrote:
text/javascript (the one i usually use)
Deprecated
application/x-javascript
Experimental

application/javascript became official sometime last year. It'll be a
while before browser support is there though I suspect, so its
probably wise to continue using text/javascript for the time being.
(Browsers tend to ignore the content type in the HTTP header for
scripts though, so moving to application/javascript on the server is
probably good future planning)

Feb 19 '07 #2
David Dorward <do*****@gmail. comwrote:
Deprecated
application/x-javascript

Experimental

application/javascript became official sometime last year. It'll be a
while before browser support is there though I suspect, so its
probably wise to continue using text/javascript for the time being.
(Browsers tend to ignore the content type in the HTTP header for
scripts though, so moving to application/javascript on the server is
probably good future planning)
OK, fine, clear enough, thanks a lot !!!
--
Une Bévue
Feb 19 '07 #3
VK
On Feb 19, 4:48 pm, "David Dorward" <dorw...@gmail. comwrote:
application/x-javascript

Experimental
application/x-javascript is default Content-Type for .js files on
Microsoft IIS for at least 8 years by now.

Do not mix with application/javascript from RFC #4329 - that is all
another joke.

Neither one is recognized by IE if used as <scriptelemen t attribute.
It means that inline scripts will be silently ignored - that's a good
reason IMO to never use neither of them.
For linked .js files one can set type="foobar/rulez" or set nothing
at all: type attribute with src set is ignored since Netscape 3.0 - so
roughly since forever.

More details can be found at:
<http://groups.google.com/group/comp....avascript/msg/
39ef46cb24e69a2 2>

Feb 19 '07 #4
VK <sc**********@y ahoo.comwrote:
<http://groups.google.com/group/comp....avascript/msg/
39ef46cb24e69a2 2>
In particular :

RFC === Request For Comments ;-)
--
Une Bévue
Feb 20 '07 #5
On Feb 19, 8:12 pm, "VK" <schools_r...@y ahoo.comwrote:
On Feb 19, 4:48 pm, "David Dorward" <dorw...@gmail. comwrote:
application/x-javascript
Experimental
application/x-javascript is default Content-Type for .js files on
Microsoft IIS for at least 8 years by now.
So? Its taken a while to become standard.
Do not mix with application/javascript from RFC #4329 - that is all
another joke.
No, its finally a standard. Nothing funny about it.
Neither one is recognized by IE if used as <scriptelemen t attribute.
Yes, I said that.
It means that inline scripts will be silently ignored - that's a good
reason IMO to never use neither of them.
Why not? Support should arrive in time, and there comes a point where
support for older browsers is dropped. We don't worry about browsers
that don't support the HTTP Host header, do we?
For linked .js files one can set type="foobar/rulez" or set nothing
at all: type attribute with src set is ignored since Netscape 3.0 - so
roughly since forever.
I might experiment with that at some point to find out exactly what
browser behaviour is. I wouldn't like to gamble on them error
correcting though.

Feb 20 '07 #6
On Feb 20, 12:22 pm, David Dorward wrote:
On Feb 19, 8:12 pm, VK wrote:
<snip>
>For linked .js files one can set type="foobar/rulez" or set
nothing at all: type attribute with src set is ignored since
Netscape 3.0 - so roughly since forever.

I might experiment with that at some point to find out exactly
what browser behaviour is.
<snip>

Why bother? VK wrote this so the odds were that it was BS to start
with, and it is.

Richard.

Feb 20 '07 #7
VK
On Feb 20, 3:22 pm, "David Dorward" <dorw...@gmail. comwrote:
It means that inline scripts will be silently ignored - that's a good
reason IMO to never use neither of them.

Why not? Support should arrive in time, and there comes a point where
support for older browsers is dropped.
<script type="applicati on/javascript">
document.write( "<p>This script will not work for 89% of visitors</
p>");
</script>

So you mean like "No big deal this block will be ignored for the
majority of my visitors. Few years latter it may start working - for
the time being consider it as a page source decoration".

Conceptual... But hardly practical - and definitely not something to
suggest IMO.

P.S. RFC != standard

Feb 20 '07 #8
VK wrote:
On Feb 20, 3:22 pm, "David Dorward" <dorw...@gmail. comwrote:
>Why not? Support should arrive in time, and there comes a point where
support for older browsers is dropped.
So you mean like "No big deal this block will be ignored for the
majority of my visitors
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.

--
David Dorward <http://blog.dorward.me .uk/ <http://dorward.me.uk/>
Home is where the ~/.bashrc is
Feb 20 '07 #9
On Feb 21, 1:27 am, "VK" <schools_r...@y ahoo.comwrote:
On Feb 20, 3:22 pm, "David Dorward" <dorw...@gmail. comwrote:
It means that inline scripts will be silently ignored - that's a good
reason IMO to never use neither of them.
Why not? Support should arrive in time, and there comes a point where
support for older browsers is dropped.
[...]
>
So you mean like "No big deal..
No, like don't say *never*, because eventually support will arrive -
maybe even for the beleaguered 89% with sub-standard browsers. :-)

[...]
P.S. RFC != standard
No one suggested it was - a fact pointed out by Une Bévue. However, a
great deal of standardisation on the web is based on RFCs.
--
Rob

Feb 21 '07 #10

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

Similar topics

2
14750
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
6111
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
1835
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
2848
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
3831
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
1623
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
4419
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
5200
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
47508
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
9855
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
10907
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
10586
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...
1
10647
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 Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
9426
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
7828
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
7017
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
5866
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
2
4064
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

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.