Implementation can be divided into three stages. First, the control definition wraps all referenced JS files.
Secondly, during the rendering of this control, using any type of algorithm (e.g. encoding / encryption) for all file paths for the string, and generate a script tag with src that points to a specific handler with the one generated as querystring .
eg. We have two files: a.js and b.js, we have a control that wraps them and generates a script tag, for example:
<script type='text/javascript' src='/js.php?include=encodeab'></script>
Thirdly, when the client side displays the html page and sends a request for this script tag, a certain server-side handler (js.php in the above case) will decode / decrypt this sequence of requests into the list of included files, and then read their contents, are combined and are output to the stream.
Hope this helps.
tshao
source share