javascripthtmlsinglepage

Put minified javascript into script tag in HTML directly


I want to put a minified java script contents in tags directly in HTML page. i have html page like:

<html>
  <head>
      <script src="jquery.js"></script>
      <script src="iemagic.js"></script>
      <script src="shim.js"></script>
      <script src="jszip.js"></script>
      <script src="xlsx.js"></script>
  </head>
</html>

I have minified all the javascript contents and put it in a single file called "all.js" and the html works fine, now it looks like :

<html>
  <head>
      <script src="all.js"></script>
  </head>
</html>

I want to include all the content of "all.js" in to HTML directly in "script" tag. I tried with that but no luck, when i open html file in browser it show all the java script content which i have copied in "script" tag.

Is there any other way for this ?


Solution

  • Thank you all for helping me. i have found the solution for this. * added all the "js" files in different "script" tag tested working fine but some of the javascript lines was visible in the browswer. * The problem was "iemagic.js" was having the comments which are not proper and was creating the problem. * I have removed those commented lines and is working find now. without having any "js" file and only one HTML. Thank you All for your help and valuable time.