Closed Thread Icon

Topic awaiting preservation: Determine size of linked CSS and JS files? (Page 1 of 1) Pages that link to <a href="http://ozoneasylum.com/backlink?for=8322" title="Pages that link to Topic awaiting preservation: Determine size of linked CSS and JS files? (Page 1 of 1)" rel="nofollow" >Topic awaiting preservation: Determine size of linked CSS and JS files? <span class="small">(Page 1 of 1)</span>\

 
Pugzly
Paranoid (IV) Inmate

From: 127.0.0.1
Insane since: Apr 2000

posted posted 09-26-2002 00:44

I'm using a bookmarklet that I've customized that is like this:

code:
javascript:
var size = (document.fileSize)*1;
var y = document.images;var imglength = 0;
for (i=0;i<y.length;i++){
imglength += (y[i].fileSize)*1;
}
size=Math.round((size/1024)*100)/100;
imglength=Math.round((imglength/1024)*100)/100;
var total = Math.round((size + imglength)*100)/100;
var writestring = 'HTML: ' + size + ' kb';
writestring += '\nImages: ' + imglength + ' kb';
writestring += '\n=============';
writestring += '\nTotal: ' + total + ' kb';
alert(writestring);



What I'd like to do is also include the sizes of linked style and script pages. Is there a way to do that?

Slime
Lunatic (VI) Mad Scientist

From: Massachusetts, USA
Insane since: Mar 2000

posted posted 09-26-2002 01:58

I didn't even know there was such a thing as document.fileSize.

I dunno about the javascript files, but look at the document.styleSheets array to see if there's anything that can be done with css...

lallous
Paranoid (IV) Inmate

From: Lebanon
Insane since: May 2001

posted posted 09-26-2002 10:32

use server side ...allow PHP to assign to your JS variables the appropriate files sizes.



InI
Paranoid (IV) Mad Scientist

From: Somewhere over the rainbow
Insane since: Mar 2001

posted posted 09-26-2002 10:53

The poster has demanded we remove all his contributions, less he takes legal action.
We have done so.
Now Tyberius Prime expects him to start complaining that we removed his 'free speech' since this message will replace all of his posts, past and future.
Don't follow his example - seek real life help first.

InI
Paranoid (IV) Mad Scientist

From: Somewhere over the rainbow
Insane since: Mar 2001

posted posted 09-27-2002 08:54

The poster has demanded we remove all his contributions, less he takes legal action.
We have done so.
Now Tyberius Prime expects him to start complaining that we removed his 'free speech' since this message will replace all of his posts, past and future.
Don't follow his example - seek real life help first.

« BackwardsOnwards »

Show Forum Drop Down Menu