Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations TouchToneTommy on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

How to determine the client connection type

Status
Not open for further replies.

ccddmm

Programmer
Mar 23, 2006
7
US
Anyone know how to determine the client connection type by using Javascript?
 
Connection type? Is it a common usage? In ie-proprietary agent, you have clientcaps behavior which exposes a connectionType. If that's not what you need, cannot help.
[tt]
<html>
<head>
<script language="javascript">
function doit() {
var oelem=document.getElementById("x");
oelem.style.behavior="url(#default#clientCaps)";
oelem.innerHTML+=oelem.connectionType;
}
window.onload=doit;
</script>
</head>
<body>
<span id="x">ConnectionType:&nbsp;</span>
</body>
</html>
[/tt]
 
Maybe you refer to the speed of the connection to the internet? As in modem, Cable, ADSL etc?

You can kind-of do this using javascript, but it's not reliable at all. Basically you would request a large image (say) of a known number of bytes. Then time how long it takes to load and work out the transfer speed. That doesn't take into consideration other people also using your connection (if shared).

As I said, it's not reliable.

Cheers,
Jeff

[tt]Jeff's Page @ Code Couch
[/tt]

What is Javascript? FAQ216-6094
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top