I generally include JavaScript files using the script tag as below.<script type=text/javascript src=somefile.js></script>I have seen some people using the language attribute as well. Now-a-days I find many people omitting the type attribute. I have started to get a feeling that if JavaScript is the default scripting language then even I should omit the type attribute. Would it be good to omit the type attribute? Would it cause any problems?
What is the best way to include JavaScript file using script tag?
javascript
Take a look at this as a reference (Book of Speed): http://www.bookofspeed.com/chapter3.htmlEssentially the best way is to combine all your javascript into one file called something like all.min.js that is also minimized.Typically in HTML5 you would do something like:<script src=js/all.min.js></script>As you can see, you DO NOT need the type attribute in HTML5, but you do in other versions of HTML and XHTML. The spec clarifies that if the content is other than text/javascript then you need to specify the type attribute, in HTML5.Some things to remember:Always include it before the closing  tag;You should load your scripts in a non-blocking pattern.Note:If you are going to specify another type other than text/javascript you would use one of the following:application/ecmascriptapplication/javascriptapplication/x-ecmascriptapplication/x-javascripttext/ecmascript text/javascripttext/javascript1.0text/javascript1.1text/javascript1.2text/javascript1.3text/javascript1.4text/javascript1.5text/jscripttext/livescripttext/x-ecmascripttext/x-javascripttext/javascript;e4x=1The above list is from: http://dev.w3.org/html5/spec-author-view/the-script-element.html#scriptingLanguagesRemember that you would not use the language attribute, only the type attribute.