Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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 ?

like image 590
user3515080 Avatar asked Aug 05 '26 00:08

user3515080


1 Answers

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.

like image 192
user3515080 Avatar answered Aug 06 '26 16:08

user3515080



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!