Quantcast
Channel: Do you need text/javascript specified in your tags? - Stack Overflow
Browsing all 12 articles
Browse latest View live

Answer by Andy Young for Do you need text/javascript specified in your tags?

👉🏻The HTML5 specification urges authors to omit the attribute rather than provide a redundant MIME type.MDNThe MIME Sniffing Standard lets JavaScript be served using any MIME type (Multipurpose...

View Article



Answer by brennanyoung for Do you need text/javascript specified in your tags?

If you're putting a script tag inside SVG you must specify the type attribute. And it should be "text/ecmascript" rather than "text/javascript". If your script is inline (not linked) you will need to...

View Article

Answer by Blesson Jose for Do you need text/javascript specified in your tags?

type="text/javascript" : Required in HTML 4 and XHTML, but optional in HTML5.CDATA : Required in XHTML.<!-- : Used to hide the JavaScript from very old browsers. Eg: Netscape 1 and Internet Explorer...

View Article

Answer by Mithun Sreedharan for Do you need text/javascript specified in your...

The type attribute identifies the scripting language of code embedded within a script element or referenced via the element’s src attribute. This is specified as a MIME type; examples of supported MIME...

View Article

Answer by Sergey Orshanskiy for Do you need text/javascript specified in your...

Well, I am tempted to say that nobody is using text/javascript any more, and that even minification tools would probably remove it...Indeed, Facebook SDK documentation specifies just <script>....

View Article


Answer by bdukes for Do you need text/javascript specified in your tags?

See Crockford's write-up on the <script> tag, most notably:Do not use the <!-- //--> hack with scripts. It was intended to prevent scripts from showing up as text on the first generation...

View Article

Answer by hellatan for Do you need text/javascript specified in your tags?

it's up to the browser to interpret the script block correctly based on the headers, i believe, and not the type attribute. So to answer your question, no it is not required for modern browsers (i'm...

View Article

Answer by gen_Eric for Do you need text/javascript specified in your tags?

HTML5 doesn't need the type="text/javascript" (it's the default).CDATA is only neeed for XHTML pages, if the script has any HTML characters (like '<' and '>') in it.<!-- should only be needed...

View Article


Answer by Michael for Do you need text/javascript specified in your tags?

Well i keep seeing more examples without the text/javascript but for some reason my scripts wont work in FF when i do so. I would recommend keeping the text/javascript declaration. The CDATA tag...

View Article


Answer by FatherStorm for Do you need text/javascript specified in your tags?

you may be thinking of this article here with the dependency being that scripts default to text/javascript in HTML5 automatically, while non-HTML5 browsers still expect that you define the type...

View Article

Answer by Pointy for Do you need text/javascript specified in your tags?

It's a Crockford recommendation. I know I've seen it echoed elsewhere (ppk maybe?). The HTML5 spec does not require it.Oddly, it's become somewhat au courant to use the "type" attribute to mark...

View Article

Do you need text/javascript specified in your tags?

I read somewhere that you no longer need things like type="text/javascript" and the weird CDATA and <!-- things in your script tags. So, instead of:<script...

View Article
Browsing all 12 articles
Browse latest View live




Latest Images