views:

60

answers:

3

Just like we include a javascript file in html

<script language="JavaScript1.2" src="CommonFunctions.js" type="text/javascript">

In this case 'CommonFunctions.js' is placed in current directory. Can we include a javascript file which is inside a zipped file?

+1  A: 

Well the answer is no.

Murali VP
+1  A: 

No, you need to unzip the file beforehand.

If you want to compress it before sending it to the browser, there are utilities to compress javascript (yui compressor, etc), and also gzip, which allows you to send compressed files across the internet before reaching the webbrowser.

CodeJoust
+1  A: 

Some people want this functionality, but currently it isn't supported.

I don't believe it's very useful either - if you zip all JS and CSS, how can you cache parts of them on the local machine? There is already GZIP too, and minification.

Images also won't make much or possibly overhead by being zipped if they are in a compressed format like PNG.

alex
+1 `Some people want this functionality` :D
Rakesh Juyal