=?ISO-8859-2?Q?Micha=B3_Wo=BCniak?= (mikiwoz_remove_this@yahoo_remove_this.co.uk) wrote:
: Malcolm Dew-Jones napisa³:
: >
ev***************@gmail.com (ev***************@gmail.com) wrote:
: > : Hi there,
: >
: > : Have you thought of javascript?
: >
: > : <script type="text/javascript">
: > : counter = 0;
: > : modemNeedsThisManyMiliseconds = 700;
: >
: > : tempImageOf100Kbs = new Image();
: > : tempImageOf100Kbs.onload = function() {
: > : window.clearInterval(
: > : milisecondCounter ); ( counter < modemNeedsThisManyMiliseconds ) ?
: > : window.location.href = "broadband.html" : window.location.href =
: > : "modem.html"}
: > : milisecondCounter = window.setInterval( "counter++", 1 );
: > : tempImageOf100Kbs.src = "http://www.yoursite.com/image.jpg";
: > : </script>
: >
: > : The long line does all the job, and apart from looking ugly it works.
: > : Of course you'll need to figure out the value of the
: > : modemNeedsThisManyMiliseconds variable...
: >
: > I wonder how long it takes a 14.4 modem to download the 100Kbs image
: > used to test the speed of the connection.
: >
: Hmmmm... I guess you could always try and test it. :)
Oh dear do I have to?
: A 14.4 modem downloads 14.4 Kb per second, that means ~1.6 KBps, which
: gives us 100 / 1.5 (not 1.6 - let's assume some overhead) = ~67s.
: But test it anyway. :)
Oh look, I don't have to test it because some nice person has just made a
very reasonable looking ball park estimate - it could take around a
minute.
A 56 K modem might therefore take about 15 seconds (very rough estimate).
Actually you do need to test it because part of the modem's speed comes
from data conmpression, which works less well on pre-compressed data (i.e.
jpeg images), so the speed could be slower than estimated.
(And of course you should test it anyway - the above is just to check
whether the approach is reasonable enough to be worth testing.)
Personally I preferred the suggestion to ask the user for their
preferences. Imagine if everybody's home page started testing the
connection speed using this technique.
In some settings the javascript might be very useful, so this is not meant
to sound derogatory in any way, just things to think about before you use
it.
--
This space not for rent.