speed detection script wanted
5 posts
• Page 1 of 1
speed detection script wanted
as it states i want to know if it even exists....
i have a highbandwidth site and a low bandwidth site set up for users, But as of right now they have to use two seperate URLs. I want to have a script run that is set in my index file to detect what speed the user is connected at and use a cookie to remember this setting, then send them to the apropriate URL.
I know how to use java to detect the screen rezolution
- Code: Select all
<script language="JavaScript1.2">
function ScreenGoToURL(Big,Medium) {
var screen_height = screen.height;
var screen_width = screen.width;
var buffer = (document.all || document.layers ||documentGetElementByID) ? 30 : 48;
if (screen_height >= 768) {
screen_width = 1024;
screen_height = 768;
var window_width = 1024-12;
var window_height = 768-buffer;
var window_top = 0;
var window_left = 0;
window.open(Big,'','resizable=yes,status=yes,scrollbars=yes,width=' + window_width + ',height=' + window_height + ',top=' + window_top + ',left=' + window_left + '');
} else {
screen_width = 800;
screen_height = 600;
var window_width = 800-12;
var window_height = 600-buffer;
var window_top = 0;
var window_left = 0;
window.open(Medium,'','resizable=yes,status=yes,scrollbars=yes,width=' + window_width + ',height=' + window_height + ',top=' + window_top + ',left=' + window_left + '');
}
}
</script>
is there a way to modify this code and just use it as in include or require_once in my index.php?
or is there another way using just php?
okay so i found this script...
**edit** it wont show the script so i have added a link to it <a href="http://www15.brinkster.com/c0ldfyr3/index.txt" target="_new">here</a>
and this goes into your body
- Code: Select all
<body>
<div id="Layer1">
<img src="56k_image.jpg" alt="loadImage" width="100" height="100" border="0" name="Myimage1"></div>
</body>
but it stores the image in the users cache, how can i stop that.. i dont want it to be stored in the users cache, it seems that if the user visits the site again in a day then they are sent to the wrong version, if they are on 56k then they get sent to the 300k site.
I think there is an HTML meta tag that can be used in the page header where you can tell the browser to no cache the page that does the bandwidth check. If it doesn't cache the page, hopefully it won't cache the image either and also make it so that anytime someone visits, the test is run again.
- imnuts
- Posts: 7457
- Joined: Wed Mar 24, 2004 5:19 am
- Location: Boothwyn, Pennsylvania
- Real Name: Mark
yeah i added that to the index page.. here it is..
but with the "<" and ">" brackets
now if i could get it to display the speed before it refreshed the page. like wait 15 seconds after showing the speed.
- Code: Select all
META HTTP-EQUIV="CACHE-CONTROL" CONTENT="NO-CACHE"
but with the "<" and ">" brackets
now if i could get it to display the speed before it refreshed the page. like wait 15 seconds after showing the speed.
5 posts
• Page 1 of 1
Return to HTML, CSS, and Scripts
Who is online
Users browsing this forum: No registered users and 4 guests