[Javascript] Detect internet connection

Laurent Muchacho LaurentM at london.virgin.net
Wed Feb 16 04:00:26 CST 2005


Hi Tim,

I saw once a script on the net who was part of movie trailer website who was
doing kind of what you looking for but it is not easy you can found the code
in this file
http://www2.warnerbros.com/all/media/v2/staticMediaClass.js
This is the url of the page where I did found the code.
http://constantinemovie.warnerbros.com/trailer.html?id=teaser

The function you looking for is called sniffSpeed 
Mainly what it does it is pretty simple when you get the logic.

	1) when the function is called I guess the document as finish
loading it set the time in a variable and it load an image from the server
this image must be a specifique size 
	2) It assign an event onload to this image like that soon as the
image finish loading it trigger the second function who will then also take
the time when it finish download 
	3) It compare the time taken with an array of I guess estimated bit
rate that it stored in this "finalBitRates"
	4) once it done doing all this it only have to select the right
radio button

I hope that help and was what you was looking for.

Laurent


-----Original Message-----
From: Tim Burgan [mailto:email at timburgan.com]
Sent: 16 February 2005 07:52
To: [javascript] javascript at latech.edu
Subject: [Javascript] Detect internet connection


Hello,


Is is possible to write a script that can detect if a user is connected 
to the internet?

Where would I find information that can help me with this?


Thanks

Tim


_______________________________________________
Javascript mailing list
Javascript at LaTech.edu
https://lists.LaTech.edu/mailman/listinfo/javascript



More information about the Javascript mailing list