tags:

views:

78

answers:

2

how to maintain Version for css and Java script in html

how to compress java script in run time

+1  A: 

To compress Javascript in runtime, you can call a server-side page which read your javascript file, minimize and cache it and return your compressed file. So you'll have to do something like:

<script src="Minimize.aspx?YourJavascriptFile.js"></script>

But, if you compress it before upload, you can save some processor cycles and memory.

Rubens Farias
A: 

To maintain javascript and css versions, you can add a version number after the file name:

<script src="MyMinimizedScript.js?version=1"></script>

when you change the javascript (or do the same for css), just change the version number. Your file name does not need to change.

Jerome C.