I have a plain html file like so
<html>
<head>
<script type="text/javascript" src="script.js"></script>
</head>
</html>
The script.js file is -
alert('hello');
I want to get the script.js in compressed form (either .gz or .zip) So, I compress the javascript file using 7-zp and get a script.js.gz. However, if I replace the above html to
<script type="text/javascript" src="script.js.gz"></script>
I get an error in firebug saying 'Illegal character'. Essentially, it is not deflating the javascript file.
Please note: I am aware of Apache mod-rewrite and additional javascript compressing techniques. However, I can't use any of that here, as I don't have that level of control on the server.
Can anyone help?
This answer in Stackoverflow gives something similar to what I'm looking for, but it gives information for Apache settings. I'm looking for the same for a plain html scenario.