VBcoders Guest



Don't have an account yet? Register
 


Forgot Password?



Many of us would like to have Scripts or html pages which could be run OFFLINE on the clients PC wh

by Don Kennedy (1 Submission)
Category: Internet/HTML
Compatability: VB Script
Difficulty: Unknown Difficulty
Originally Published: Sun 11th March 2001
Date Added: Mon 8th February 2021
Rating: (1 Votes)

Many of us would like to have Scripts or html pages which could be run OFFLINE on the clients PC when they are NOT connected to the internet.

API Declarations


//
// Returns:This example just uses an ALERT BOX when the Browser is offline. you
// can replace that with any logic you wish
// , or just inform the person that they mu
// st be online to use your Page or Script.
//
//
// Assumes:Not only does this tell you i
// f the Client PC is ONLINE or OFFLINE it
// also tells you if the Client PC is Dial-
// up or High-Speed. This means you could a
// lso use this to determine Download optio
// ns if your visitor is accessing your sit
// e via a Slow speed dial-up line you coul
// d re-direct to pages with less images ju
// st for them so that pages would load fas
// ter for dial-up visitors. Neat huh.
No alert was added for this check however you can see that could be done very easily ;-)
//
// Side Effects:Joy to those of use whom
// needed a way to take a diffenert path su
// ch as getting Gifs, scripts from a direc
// tory on the users hard drive when the us
// er wishes to use our tools or applicatio
// ns offline and the HTML is pointing to a
// WEB Site for scripts of images.
//


Rate Many of us would like to have Scripts or html pages which could be run OFFLINE on the clients PC wh




<HEAD>

<STYLE>
MSIE\:CLIENTCAPS {behavior:url(#default#clientcaps)}
</STYLE>

</HEAD>

<body tabindex="-1">

<MSIE:CLIENTCAPS ID="idClCap" />

<script language="JavaScript">

var str = document.all.idClCap.connectionType;

alert (str); 

        if (str == "lan")
                downloadSpeed = 800;     // good estimate for LAN - 800 KB/min
        else if (str == "offline")
{
                downloadSpeed = 100;    // default to modem speed if offline
isoffline = true;
                alert (document.all.idClCap.connectionType);
}
        else
                downloadSpeed = 120;    // good estimate for 28.8kbps modem, 120 KB/min

alert (downloadSpeed); 


</SCRIPT>
</BODY>
</HTML>

Download this snippet    Add to My Saved Code

Many of us would like to have Scripts or html pages which could be run OFFLINE on the clients PC wh Comments

No comments have been posted about Many of us would like to have Scripts or html pages which could be run OFFLINE on the clients PC wh. Why not be the first to post a comment about Many of us would like to have Scripts or html pages which could be run OFFLINE on the clients PC wh.

Post your comment

Subject:
Message:
0/1000 characters