|
|
![]() |
#1 |
Vagabond
|
Want to shrink your TGP's?
No, not make them smaller, but at least shrink the file size and make them load faster
![]() I was going through one of my script folders and found a javascript I used when I had TGP's. I was never a fan of having something random in the status bar. So the solution was to have an onmouseover + onfocus on all links, which made the pages HUGE. A regular link would look something like this: <a href="thumbs.php?pct=85&link=pic3&url=http://www.gallerydomain.com/00276197-01-01/pictures/05/index.php" onMouseover="window.status='http://www.gallerydomain.com/00276197-01-01/pictures/05/index.php'; return true;" onFocus="window.status='http://www.gallerydomain.com/00276197-01-01/pictures/05/index.php'; return true;" onMouseout="window.status=''> That link is 355 bytes. Now lets change it to something smaller <a href="thumbs.php?pct=60&link=pic47&url=http://www.gallerydomain.com/00276197-01-01/pictures/05/index.php" onMouseover="ds(href);return true" onFocus="ds(href);return true" onMouseout="os()"> That link is 193 bytes. What you need to put between your <head> and </head> is this: <script> function ds(msg) { var surl = msg.match(/url=([^&]*)/, "$1") status=unescape(surl[1]) } function os() { status='' } </script> So if your TGP has 300 links you would save 47kB. That's a lot of load time if you're on a modem ![]() |
![]() |
![]() |
![]() |
#2 |
No offence Apu, but when they were handing out religions you must have been out taking a whizz
|
hey thanks, I needed something like that
![]() |
![]() |
![]() |
![]() |
#3 |
The information superhighway showed the average person what some nerd thinks about Star Trek
Join Date: Mar 2005
Location: California
Posts: 337
|
Nice tip, thanks!
If you're really anal about bandwidth, you can also use an HTML shrinker (or HTML compressor) that removes all the whitespace. |
![]() |
![]() |
![]() |
#4 |
Just because I don't care doesn't mean I don't understand!
|
Just what I needed thanks man great tip
|
![]() |
![]() |
![]() |
Thread Tools | Search this Thread |
Display Modes | Rate This Thread |
|
|