Page 1 of 1

Javascript Mime Type

PostPosted: 16. June 2009 19:26
by karl33to
Hi,

Have just ran into a problem with Xampp and I though't I'd share my solution incase anybody else is having the same problems, or if something is amiss with the configuration of Xammp, might save someone a few hours worth of faffing :D

Basically, with a fresh install of Windows XP I've downloaded Xampp for win32 version 1.7.1 and got it up and running & tested that Apache PHP and MYSQL are all working without any problems.

I've then gone on to install the latest version of TinyMCE 3.2.4.1, which would work whilst browsing to the files, but refused to work when they were served through Apachce. The error Firebug was reporting was that there was an "illegal character" in the javascript on line 1, which was causing it to failing loading.

Opening the javascript file directly in Firefox, the browsed to version looked fine, but the Xampp/Apache version was all garbled, further inspection revealed that there were slightly different mime types for the "browsed-to" version [application/x-javascript] and the Xampp/Apache version [application/javascript].

So I opened up apache/conf/mime.types found the line for javascript, and changed it
Code: Select all
# from this
application/javascript         js
# to this
application/x-javascript         js

and hey presto, the Firefox is now happy with the mime-type and TinyMCE now loads correctly, and I'm a happy bunny again 8)

Re: Javascript Mime Type

PostPosted: 22. October 2009 07:16
by zottona
Can javaScript extract or rather read and write? I would like to read from and write to files using JavaScript. How can this be done and what type of files can be uses? I know about Ajax and php, but what about JavaScript. without the asynchronous xml technology?
_____________
affiliateelite ~ affiliateelite.com ~ adgooroo ~ adgooroo.com

Re: Javascript Mime Type

PostPosted: 22. October 2009 07:44
by Izzy
zottona wrote:Can javaScript extract or rather read and write? I would like to read from and write to files using JavaScript. How can this be done and what type of files can be uses? I know about Ajax and php, but what about JavaScript. without the asynchronous xml technology?
Off topic in this forum and nothing at all to do with XAMPP for Windows.

Here read this.


BTW, I see you posting exactly this same content under different names all over the Internet, you even got your questions resolved, so why are you continuing to post it and why in these XAMPP forums?
By Keemore - http://answers.yahoo.com/question/index ... 957AA1CxO5
By tiffanly - http://www.forum.trshady.com/viewtopic.php?p=825566

Re: Javascript Mime Type

PostPosted: 27. February 2014 07:22
by andrikaa
Difference between java and javascript? What's the difference between java and javascript? Is a java applet (opened via an html document or applet viewer) javascript. If you look at the code of javascript is it the same as Java? Does it follow exactly the same rules. Is the only difference the fact that it is executed through HTML ?
________________________________
quick healthy meals ~ quick recipes for dinner ~ simple dinner recipes

Re: Javascript Mime Type

PostPosted: 27. February 2014 11:15
by Nobbie
andrikaa wrote:Difference between java and javascript?


You missed one: JavaServerLanguage.

andrikaa wrote:Is a java applet (opened via an html document or applet viewer) javascript.


No. A Java Applet is a compiled module, it is compiled by the Java Development Kit (JDK) and it is executed by the Java Runtime Environment (JRE). It is executed on your PC. Java applets can also run in a normal environment (not a webserver / browser environment).

andrikaa wrote:If you look at the code of javascript is it the same as Java?


No. They look a little similar (basic syntax is very close), but is quite different anyway. Javascript is ALWAYS embedded in HTML, as it is executed by the browser. The classes and objects of Java and Javascript are very different, Javascript is designed to fit to the needs of a HTTP/HTML environment.

andrikaa wrote:Does it follow exactly the same rules. Is the only difference the fact that it is executed through HTML ?


No. You cannot run a non-compiled Java Applet in a HTML file thru the browser, this leads to error.

Finally (as mentioned before) there is also a JavaServerLanguage, it is also close to Java (but again not identical) and this a postprocessor for HTML files as PHP for example. There is a special Apache version which contains an embedded JavaServerLanguage (JSL) Interpreter and this special Apache is called "Tomcat".

Three different things with somehow close syntax, but not the same.