file type in HTML?

1

What would be the difference between using:

<script></script>

With type in this way:

type="text/javascript"

Or this way:

type="application/javascript"
    
asked by Eduardo Sebastian 10.08.2017 в 17:40
source

2 answers

1

The differences are not many, almost nothing, good nothing .

<script></script> It allows the insertion of code next to the client as Javascript this tag without attributes, basically you would not be specifying the MIME of the script and if not specified is text/javascript this from html5 .

With:

type="text/javascript" You simply specify that the language to be used will be Javascript

And with:

type="application/javascript" Same as text / javascript , although it is preferable to use the previous one.

besides those two options you also have

type="text/ecmascript" That specifies the programming language published by ECMA International based on javascript.

and

type="text/vbscript" That specifies the interpreted programming language based on Visual Basic.

    
answered by 10.08.2017 / 17:54
source
0

There would be no difference, "text / javascript" is already obvsolete although it is supported in HTML 4 and 5, unlike the application / javascript, it has support for several browsers.

    
answered by 10.08.2017 в 17:48