View Single Post
Default   #60   Coda Coda is offline
Developer
Heh. What an interesting question.

Use "text/javascript".

The story goes that "application/javascript" was introduced in 2006 in an attempt to standardize the MIME types of executable content, and "text/javascript" was deprecated. Most browsers supported it right away because they didn't pay a whole lot of attention to the MIME type of scripts, because they only supported Javascript anyway. Mozilla picked up the change and updated all of their examples to match it, because that's what the standards said to do.

Unfortunately for the standards committee, Internet Explorer didn't pick up support for it until 2011. (IE had support for other scripting languages in the browser, most notably VBScript.)

Five years is a LONG FREAKING TIME on the Internet, and when one of the most well-known browsers in the world doesn't support something, that basically means you can't use it. And by then, pretty much everyone but standards purists had forgotten about "application/javascript". As a result, the HTML5 standard requires support for "text/javascript". It has this to say:

Quote:
Originally Posted by HTML5 spec
Note: The term "JavaScript" is used to refer to ECMA262, rather than the official term ECMAScript, since the term JavaScript is more widely known. Similarly, the MIME type used to refer to JavaScript in this specification is text/javascript, since that is the most commonly used type, despite it being an officially obsoleted type according to RFC 4329.
EDIT: As for <canvas> itself, I'm pretty good with it if you need any help. Gravity Runner (in the thread linked in my sig) is canvas-based.
Games by Coda (updated 4/8/2025 - New game: Marianas Miner)
Art by Coda (updated 8/25/2022 - beatBitten and All-Nighter Simulator)

Mega Man: The Light of Will (Mega Man / Green Lantern crossover: In the lead-up to the events of Mega Man 2, Dr. Wily has discovered emotional light technology. How will his creations change how humankind thinks about artificial intelligence? Sadly abandoned. Sufficient Velocity x-post)
Old Posted 01-03-2017, 01:22 PM Reply With Quote