Javascript Mime Type

Problems with the Windows version of XAMPP, questions, comments, and anything related.

Javascript Mime Type

Postby karl33to » 16. June 2009 19:26

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)
karl33to
 
Posts: 1
Joined: 16. June 2009 19:06

Re: Javascript Mime Type

Postby zottona » 22. October 2009 07:16

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
Last edited by zottona on 29. October 2009 06:50, edited 1 time in total.
zottona
 
Posts: 2
Joined: 15. October 2009 08:51

Re: Javascript Mime Type

Postby Izzy » 22. October 2009 07:44

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
Izzy
 
Posts: 3344
Joined: 25. April 2006 17:06

Re: Javascript Mime Type

Postby andrikaa » 27. February 2014 07:22

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
Last edited by andrikaa on 01. March 2014 09:17, edited 1 time in total.
andrikaa
 
Posts: 1
Joined: 13. February 2014 11:09
Operating System: bnmnbmnm

Re: Javascript Mime Type

Postby Nobbie » 27. February 2014 11:15

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.
Nobbie
 
Posts: 13170
Joined: 09. March 2008 13:04


Return to XAMPP for Windows

Who is online

Users browsing this forum: No registered users and 134 guests