Is it possible that where the "language" of the script is not explicitly defined, the JavaScript will not be executed?
<script type="text/javascript">
This piece of JavaScript which is embedded onto the JSP / HTML page.
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
The MIME-Type of the file is set by the server. For JS files a MIME-Type of
text/javascriptshould be returned. It’s not doing this here, that’s why you get the notice.The
languageproperty in<script>is deprecated.is correct.
Also see: What is the difference between "lang" and "type" attributes in a script tag?
The MIME-type is a header the server sends along with any file that is requested. The client is free to ignore it of course. Usually if your file is a *.js file your webserver will select the right MIME-type for you, if your file is a .jsp script that returns a JavaScripts file then you will likely need to set the MIME-type header yourself, this is fairly trivial in most languages, I wouldn’t know how to do it in JSP but in PHP it’s: header(“MIME-Type: text/javascript”); anywhere before you start echo’ing the actual content.