Computer Science, asked by gourav2715, 1 year ago

Do you need text/javascript specified in your

Answers

Answered by Anonymous
0

[tex]\huge\bold\blue{ANSWER }[\tex]

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 courantto use the "type" attribute to mark <script> blocks that you don't want to be evaluated:

<script type='text/html-template'> <div> this is a template </div> </script>

By giving a weird non-JavaScript type, you get a way to stuff raw text into the page for use by other JavaScript code (which is presumably in script block that can be evaluated).

Answered by Anonymous
0

HTML5 doesn't need thetype="text/javascript" (it's the default). CDATA is only neeed for XHTML pages, if the script has any HTML characters (like '<' and '>') in it. ... Thetype attribute specifies the scripting language of the element's contents and overrides the default scripting language.

Similar questions