PC Review


Reply
Thread Tools Rate Thread

application/x-javascript vs. text/javascript.

 
 
Peter Rilling
Guest
Posts: n/a
 
      13th Mar 2004
What is the difference between application/x-javascript and text/javascript.
While writing a web spider, I notice that different servers may send
different content code. Also on one particular site, the text within the
HTML for the <script> tag indicates "text/javascript" while the server
actually sends down content of type "application/x-javascript". Are there
other types that I should be aware of for identifying javascript files.


 
Reply With Quote
 
 
 
 
Martin Honnen
Guest
Posts: n/a
 
      14th Mar 2004


Peter Rilling wrote:

> What is the difference between application/x-javascript and text/javascript.
> While writing a web spider, I notice that different servers may send
> different content code. Also on one particular site, the text within the
> HTML for the <script> tag indicates "text/javascript" while the server
> actually sends down content of type "application/x-javascript". Are there
> other types that I should be aware of for identifying javascript files.


There is no registered MIME type for JavaScript, when Netscape 3 introduced
<script src="file.js" language="JavaScript"></script>
they suggested to use
application/x-javascript
as the Content-Type associated with .js files on the server.
Later the HTML 4 specification introduced
<script type="mime-type"
and suggested to use
<script type="text/javascript"
and that way you nowadays find most pages using that while servers
mostly still use application/x-javascript.
Browsers noadays should accept both types I think.
As for other types, with SVG (scalable vector graphics) you can also
find text/ecmascript, again nothing registered but somehow used as
ECMAScript is the standard for the core JavaScript language.

--

Martin Honnen
http://JavaScript.FAQTs.com/

 
Reply With Quote
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Generated JavaScript vs. Manually Created JavaScript: Which one comes first? Nathan Sokalski Microsoft ASP .NET 4 8th Nov 2007 07:24 AM
How to fire Javascript events from a .NET winforms user control back to Javascript in IE jonathan.beckett Microsoft Dot NET 0 13th Jul 2006 02:51 PM
How to make javascript close to work in c# windows application (Custom IE Application) Ashok Microsoft C# .NET 0 4th Jun 2004 04:55 PM
Help: getting javascript & c# to talk together in asp.net web application Alex Microsoft ASP .NET 2 13th Feb 2004 02:16 PM
Javascript:void(null); or Javascript:; -problem clicking certain js action items chribjor Windows XP Internet Explorer 1 21st Jan 2004 11:57 PM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 01:16 PM.