| |||||||
This is a discussion on Check Your Connection Speed (Java Script) within the HTML/CSS/JavaScript section, part of the Programming category; :o Buddies This Script Is for checking your Actual Connection Speed. -------------------------------------------------------------- <html> <head> <meta name="Jeet" content="JEET ,dreams4desires@gmail.com"> <script type="text/javascript" ...
![]() |
|
| | LinkBack | Thread Tools | Display Modes |
|
#1
| ||||
| ||||
| Check Your Connection Speed (Java Script)
:o Buddies This Script Is for checking your Actual Connection Speed. -------------------------------------------------------------- <html> <head> <meta name="Jeet" content="JEET ,dreams4desires@gmail.com"> <script type="text/javascript" language="JavaScript"> message = "Calculating the connection speed^" scrollSpeed = 20 // lower is slower // lineDelay = 1500 // Do not change the text below // txt = "" function scrollText(pos) { if (message.charAt(pos) != '^') { txt = txt + message.charAt(pos) status = txt pauze = scrollSpeed } else { pauze = lineDelay txt = "" if (pos == message.length-1) pos = -1 } pos++ setTimeout("scrollText('"+pos+"')",pauze) } // Unhide --> scrollText(0) if ((navigator.userAgent.indexOf("Opera") >= 0) && (((navigator.userAgent.indexOf("6.02") >= 0) && (navigator.userAgent.indexOf("Linux") < 0)) || ((navigator.userAgent.indexOf("6.03") >= 0) && (navigator.userAgent.indexOf("Linux") < 0)) || (navigator.userAgent.indexOf("6.04") >= 0) || (navigator.userAgent.indexOf("6.05") >= 0))) { top.location.href = "SorryOpera.html"; } /* if (navigator.userAgent.indexOf("Safari") >= 0) { top.location.href = "SorrySafari.html"; } */ </script> <script language="JavaScript"> Javascript = 10; </script> <script language="JavaScript1.2"> Javascript = 12; </script> <script language="JavaScript" type="text/javascript"> <!-- Plaatjes = new Array( new Array("http://www.ugo.com/includes/masthead/images/logo.gif",90,90,12410,"Ugo","#000000",0,0,15), new Array("http://www.aol.com/gr/homepage/aolanywhere.gif",249,43,2029,"America Online, Inc.","#FFFFFF",0,0,2), new Array("http://welcome.hp.com/country/img/logo.gif",66,55,1079,"HP","#FFFFFF",0,0,33), new Array("http://www.apple.com/t/2002/us/en/i/1.gif",118,32,2067,"Apple","#FFFFFF",0,0,38), new Array("http://www.msnbc.com/i/cov/b.gif",165,89,3912,"MSNBC","#FFFFFF",0,0,27), new Array("http://graphics7.nytimes.com/images/section/homepage/NYT_home_banner.gif",409,59,3315,"nytimes","#FFFFF F",0,0,39), new Array("http://g-images.amazon.com/images/G/01/icons/amazon-logo.gif",140,30,1679,"Amazon","#FFFFFF",0,0,11), new Array("http://msimg.com/w/logo_bf2.gif",140,60,1251,"MSN","#FFFFFF",0,0,30), new Array("http://www.looksmart.com/i/ls_logo_title.gif",399,30,2506,"Looksmart","#FFFFF F",0,0,17), new Array("http://image.com.com/graphics/d5/logo_f.gif",60,42,1086,"ZDnet","#1E5C99",0,0,19), new Array("http://img1.us4.outblaze.com/mail.com/nav_logo.gif",709,56,3508,"Mail.com","#003566",0,0 ,26), new Array("http://images.about.com/all/logos/h_clogo_1.gif",272,70,4741,"About","#FFFFFF",0,0,2 5), new Array("http://www.homestead.com/defaultUser/emergencyImages/hslogo_with_tagline_158x50.gif",158,50,2726,"Homes tead","#FFFFFF",0,0,7), new Array("http://www.webshots.com/mimgs/webshots_logo_part_of140x56.gif",140,56,2482,"Webs hots","#FFFFFF",0,0,34), new Array("http://nbci.msnbc.com/header.jpg",780,72,25535,"NBCi","#FFFFFF",0,0,24), new Array("http://image.weather.com/pics/weather_logo.gif",125,20,1652,"Weather.com","#8080 80",0,0,29), new Array("http://www.nasa.gov/templateimages/template/header/logo_nasa.gif",288,51,4773,"nasa","#FFFFFF",0,0,36 ), new Array("http://www.everyone.net/graphics/logo_tag.gif",180,55,2405,"Everyone.net","#FFFFFF" ,0,0,37), new Array("http://www.cnn.com/images/hub2000/main/cnn.com.logo.gif",167,40,1717,"CNN","#FFFFFF",0,0, 10), new Array("http://pics.ebay.com/aw/pics/homepage/ebaylogo.gif",169,66,2516,"Ebay","#FFFFFF",0,0,13) , new Array("http://www.spedia.net/imgs/logosped.gif",110,63,1088,"Spedia","#FFFFFF",0,0,2 1), new Array("http://www.synacor.com/images/synacor_logo.gif",183,73,2533,"Synacor","#990000", 0,0,8), new Array("http://www.macromedia.com/images/master/logo_macromedia.gif",41,20,508,"Macromedia","#EEEE EE",0,0,16), new Array("http://oracleimg.com/admin/images/ocom/hp_ora_logo.gif",248,33,1815,"Oracle","#FFFFFF",0, 0,32), new Array("http://www.cnet.com/i/se/hd_lg.gif",356,73,6794,"Cnet","#FFCC00",0,0,9), new Array("http://www.targetnet.com/images/navbar_01.gif",285,70,4480,"Targetnet","#FFFFFF",0 ,0,35), new Array("http://www.snowball.com/common_images/snowball_logo1.gif",275,75,2695,"Snowball","#FFFFF F",0,0,18), new Array("http://guest.friendfinder.com/ff/images/topbar_mem/topjoin2.gif",377,38,6174,"FriendFinder","#FFFFFF" ,0,0,22), new Array("http://www.sun.com/pics/sunlogo.gif",119,60,1654,"Sun","#666699",0,0,28), new Array("http://images.real.com/pics/real/home/med_rc.gif",111,84,1839,"Real.com","#000000",0,0,4 ), new Array("http://www.microsoft.com/library/homepage/images/bnr_all.gif",250,60,8387,"Microsoft","#6699CC",0,0 ,1), new Array("http://lygo.com/ly/nb.gif",116,19,799,"Lycos","#000000",0,0,3), new Array("http://www.nettaxi.com/images/topleftin.gif",230,96,5284,"NetTaxi","#FFFFFF",0,0 ,20), new Array("http://www.go.com/static/images/gologo_blu.gif",101,45,2128,"Go.com","#336699",0,0 ,5), new Array("http://www.cisco.com/images/homepage/logo-tagline.gif",107,87,1574,"Cisco","#FFFFFF",0,0,12) , new Array("http://image.imgfarm.com/ex/lg/exmy_lg.gif",140,64,2474,"Excite","#000000",0,0,6) , new Array("http://www.passportimages.com/PassportLogo140x44.gif",140,44,1965,"Microsoft Passport","#FFFFFF",0,0,14), new Array("http://us.i1.yimg.com/us.yimg.com/i/yahoo.gif",147,31,1403,"Yahoo","#FFFFFF",0,0,0), new Array("http://cbs.sportsline.com/images/hdrlogo.gif",300,60,3944,"CBS SportsLine","#FFFFFF",0,0,23)); Threads = new Array(4); for (Thread = 0; Thread < 4; Thread++) { Threads[thread] = new Array(-1,0); } TotaalBytes = 0; TotaalTijd = 0; Starttijd = 0; LaatsteLampje = 0; MaxWidth = 100; MaxHeight = 60; AvgSpeed = 0; Bps = 0; icount = 0; function ShowStatus() { Bps = 0; if (TotaalTijd > 0) { Bps = Math.round(TotaalBytes * 1000 * 4 / TotaalTijd); icount = icount+1; AvgSpeed = AvgSpeed + Bps; } k = Math.round(20 - (Now.getTime() - Starttijd) / 1000); j = Math.round(60 * k / 20); Out = '<html><head>' + '<meta http-equiv=expires content="0">' + '<meta http-equiv=pragma content="no-cache">' + '</head><body bgcolor="#FFEE00" text="#4F1900">' + '<table width="100%" border=0 cellspacing=3 cellpadding=2><tr>' + '<td valign=center><font face="Verdana, Arial, Helvetica, sans-serif" size="1"><b>bytes per<br>second</b></font></td>' + '<td width="100%" bgcolor="#FFEE00">' + '<table width="100%" border=0 cellspacing=0 cellpadding=0><tr>' + '<td valign=center bgcolor="#FFEE00"><font face="Verdana, Arial, Helvetica, sans-serif" size="1"><b><font> ' + Bps + ' Bps </font></b></font></td>' + '<td valign=center bgcolor="#FFEE00" align=center width="100%"><font face="verdana" size="1">' + 'Calculating speed, please wait...<br>' + k + ' seconds to go.' + '</font></font></td>' + '<td valign=center bgcolor="#FFEE00"><font face="Verdana, Arial, Helvetica, sans-serif" size="1"><b><font> ' + Math.round(Bps * 8 / 1024) + ' kbps </font></b></font></td>' + '</tr></table></td>' + '<td valign=center><font face="Verdana, Arial, Helvetica, sans-serif" size="1"><b>kilobits per<br>second</b></font></td>' + '</tr></table>' + '<center><font face="Arial, Helvetica, sans-serif" size="4"><font color="#FFFFFF">'; for (i = j; i < 60; i++) Out += '¯'; Out += '</font>'; for (i = 0; i < j; i++) Out += '¯'; Out += '</font></center>'; Out += '</body></html>'; /*Out = '<html><head>' + '</head><body bgcolor="#FFEE00" text="#4F1900">' + '<table width="100%" border=0 cellspacing=3 cellpadding=2><tr>' + '<td valign=center><font face="Verdana, Arial, Helvetica, sans-serif" size="+1"><b>' + '<td width="100%" valign="top">' + 'Calculating speed, please wait...<br></td></tr></table>'*/ frames["Top"].document.open("text/html","replace"); frames["Top"].document.write(Out); frames["Top"].document.close(); } |
|
#2
| ||||
| ||||
|
function StartPlaatje(Thread) { j = Math.round(Math.random() * 40); for (i = 0; i < 40; i++) { Plaatje = i + j; if (Plaatje >= 40) { Plaatje = Plaatje - 40; } if (Plaatjes[Plaatje][0] == "") continue; if (Plaatjes[Plaatje][6] > 0) continue; for (x = 0; x < 4; x++) { if (Threads[x][0] == Plaatje) break; } if (x >= 4) break; } if (i >= 40) { for (i = 0; i < 40; i++) { Plaatje = i + j; if (Plaatje >= 40) { Plaatje = Plaatje - 40; } if (Plaatjes[Plaatje][0] == "") continue; for (x = 0; x < 4; x++) { if (Threads[x][0] == Plaatje) break; } if (x >= 4) break; } if (i >= 40) return; } Now = new Date(); Threads[thread][0] = Plaatje; Threads[thread][1] = Now.getTime(); Frame = "Frame" + Plaatje; w = Plaatjes[Plaatje][1]; h = Plaatjes[Plaatje][2]; if (h > MaxHeight) { w = Math.round(Plaatjes[Plaatje][1] * MaxHeight / Plaatjes[Plaatje][2]); h = MaxHeight; } if (w > MaxWidth) { w = MaxWidth; h = Math.round(Plaatjes[Plaatje][2] * MaxWidth / Plaatjes[Plaatje][1]); } Color = ' bgcolor=#ffffff'; /* hide if (Plaatjes[Plaatje][5] != '') Color = ' bgcolor="' + Plaatjes[Plaatje][5] + '"'; */ frames[Frame].document.open("text/html","replace"); frames[Frame].document.write( '<html><head>' + '<meta http-equiv=expires content="0">' + '<meta http-equiv=pragma content="no-cache">' + '</head><body ' + Color + '>' + '<table width="100%" height="100%" cellspacing=0 cellpadding=0>' + '<tr><td height="100%" align=center>' + '<div id="status1"><br><br>Free test in progress, please wait...<br></div>' + '<img ' + 'src="' + Plaatjes[Plaatje][0] + '?a' + Now.getTime() + '=1" ' + 'width=' + w + ' height=' + h + ' border=0 ' + 'ONLOAD="parent.FrameLoaded(self.name)" ' + 'ONERROR="parent.FrameError(self.name)" ' + 'ONABORT="parent.FrameError(self.name)" ' + 'alt="' + Plaatjes[Plaatje][4] + '"></td></tr>' + '</table></body></html>'); frames[Frame].document.close(); } function FrameLoaded(Frame) { for (Thread = 0; Thread < 4; Thread++) { if (Frame == "Frame" + Threads[thread][0]) break; } if (Thread >= 4) return; Plaatje = Threads[thread][0]; Threads[thread][0] = -1; if (Plaatjes[Plaatje][0] != "") { Now = new Date(); Plaatjes[Plaatje][6] = Plaatjes[Plaatje][6] + 1; Plaatjes[Plaatje][7] = Plaatjes[Plaatje][7] + Now.getTime() - Threads[thread][1]; TotaalBytes = TotaalBytes + Plaatjes[Plaatje][3]; TotaalTijd = TotaalTijd + Now.getTime() - Threads[thread][1]; } setTimeout('StartPlaatje(' + Thread + ')',0); } function FrameError(Frame) { for (Thread = 0; Thread < 4; Thread++) { if (Frame == "Frame" + Threads[thread][0]) break; } if (Thread >= 4) return; Plaatje = Threads[thread][0]; if (Threads[thread][0] == -1) return; Threads[thread][0] = -1; Plaatjes[Plaatje][0] = ""; setTimeout('StartPlaatje(' + Thread + ')',0); } |
|
#3
| ||||
| ||||
|
function Stop() { AvgSpeed = Math.round(AvgSpeed/icount); AvgSpeedK = Math.round(AvgSpeed * 8 / 1000) for (Thread = 0; Thread < 4; Thread++) { Threads[thread][0] == -1; } Now = new Date(); Metingen = ''; Tijden = ''; PlaatjeNrs = ''; for (Plaatje = 0; Plaatje < 40; Plaatje++) { if (Plaatjes[Plaatje][6] < 0) Plaatjes[Plaatje][6] = 0; if (Metingen != '') Metingen += '+'; Metingen += Plaatjes[Plaatje][6]; if (Plaatjes[Plaatje][7] < 0) Plaatjes[Plaatje][7] = 0; if (Tijden != '') Tijden += '+'; Tijden += Plaatjes[Plaatje][7]; if (PlaatjeNrs != '') PlaatjeNrs += '+'; PlaatjeNrs += Plaatjes[Plaatje][8]; } Url = 'check_result.asp?' + 'L=world' + '&D=' + (Now.getTime() - Starttijd) + '&D2=' + Now.getTime() + '&Layout=1' + '&Duration=20' + '&Repeat=600' + '&T=' + Tijden + '&M=' + Metingen + '&P=' + PlaatjeNrs + '&AvgSpeed=' + AvgSpeed + '&AvgSpeedK=' + AvgSpeedK + '&K=' + escape('QlVbWlxeDAheDBRACwUYFgIHDA=='); if (Now.getTime() < Starttijd + 20000) { Url = Url + '&Z=0'; } else { Url = Url + '&Z=1'; } window.close(); window.opener.location = Url; /* location = Url; */ return; } function Run() { Now = new Date(); k = Math.round((Now.getTime() - Starttijd) / 1000); if (k > 20) { Stop(); return; } for (Thread = 0; Thread < 4; Thread++) { if ((Threads[thread][0] >= 0) && (Now.getTime() > Threads[thread][1] + 15000)) { Plaatje = Threads[thread][0]; Threads[thread][0] = -1; Plaatjes[Plaatje][0] = ""; setTimeout('StartPlaatje(' + Thread + ')',0); } } ShowStatus(); setTimeout('Run()',1000); } function Start() { if (Javascript >= 12) { if ((document.body) && (document.body.clientWidth)) { MaxWidth = Math.round(document.body.clientWidth / 4 - 8); MaxHeight = Math.round((document.body.clientHeight - 65 - 30) / 10 - 8); } else { if (window.innerWidth) { MaxWidth = Math.round(window.innerWidth / 4 - 8); MaxHeight = Math.round((window.innerHeight - 65 - 30) / 10 - 8); } } } /* frames["Banner"].location = "includes/top_bar.asp";*/ Now = new Date(); Starttijd = Now.getTime(); ShowStatus(); /* hide for (Plaatje = 0; Plaatje < 40; Plaatje++) { Color = ''; if (Plaatjes[Plaatje][5] != '') Color = ' bgcolor="' + Plaatjes[Plaatje][5] + '"'; frames["Frame" + Plaatje].document.open("text/html","replace"); frames["Frame" + Plaatje].document.write('<html><body' + Color + '><center>' + Plaatjes[Plaatje][4] + '</center></body></html>\n'); frames["Frame" + Plaatje].document.close(); } */ for (Thread = 0; Thread < 4; Thread++) { setTimeout('StartPlaatje(' + Thread + ')',0); } setTimeout('Run()',1000); } // --> </script> <noscript> <meta http-equiv=refresh content="0; url=NoJavascript.html"> </noscript> </head> <frameset rows="0,*,0" border=1 frameborder=yes onload=Start()> <frame src="about:blank" name=Banner noresize scrolling=no marginwidth=0 marginheight=0> <frame src="about:blank" name=Top noresize scrolling=no marginwidth=0 marginheight=0> <frameset cols="*,*,*,*" border=0 frameborder=no> <frameset rows="*,*,*,*,*,*,*,*,*,*" border=0 frameborder=no> <frame src="about:blank" name=Frame0 noresize scrolling=no marginwidth=0 marginheight=0> <frame src="about:blank" name=Frame1 noresize scrolling=no marginwidth=0 marginheight=0> <frame src="about:blank" name=Frame2 noresize scrolling=no marginwidth=0 marginheight=0> <frame src="about:blank" name=Frame3 noresize scrolling=no marginwidth=0 marginheight=0> <frame src="about:blank" name=Frame4 noresize scrolling=no marginwidth=0 marginheight=0> <frame src="about:blank" name=Frame5 noresize scrolling=no marginwidth=0 marginheight=0> <frame src="about:blank" name=Frame6 noresize scrolling=no marginwidth=0 marginheight=0> <frame src="about:blank" name=Frame7 noresize scrolling=no marginwidth=0 marginheight=0> <frame src="about:blank" name=Frame8 noresize scrolling=no marginwidth=0 marginheight=0> <frame src="about:blank" name=Frame9 noresize scrolling=no marginwidth=0 marginheight=0> </frameset> <frameset rows="*,*,*,*,*,*,*,*,*,*" border=0 frameborder=no> <frame src="about:blank" name=Frame10 noresize scrolling=no marginwidth=0 marginheight=0> <frame src="about:blank" name=Frame11 noresize scrolling=no marginwidth=0 marginheight=0> <frame src="about:blank" name=Frame12 noresize scrolling=no marginwidth=0 marginheight=0> <frame src="about:blank" name=Frame13 noresize scrolling=no marginwidth=0 marginheight=0> <frame src="about:blank" name=Frame14 noresize scrolling=no marginwidth=0 marginheight=0> <frame src="about:blank" name=Frame15 noresize scrolling=no marginwidth=0 marginheight=0> <frame src="about:blank" name=Frame16 noresize scrolling=no marginwidth=0 marginheight=0> <frame src="about:blank" name=Frame17 noresize scrolling=no marginwidth=0 marginheight=0> <frame src="about:blank" name=Frame18 noresize scrolling=no marginwidth=0 marginheight=0> <frame src="about:blank" name=Frame19 noresize scrolling=no marginwidth=0 marginheight=0> </frameset> <frameset rows="*,*,*,*,*,*,*,*,*,*" border=0 frameborder=no> <frame src="about:blank" name=Frame20 noresize scrolling=no marginwidth=0 marginheight=0> <frame src="about:blank" name=Frame21 noresize scrolling=no marginwidth=0 marginheight=0> <frame src="about:blank" name=Frame22 noresize scrolling=no marginwidth=0 marginheight=0> <frame src="about:blank" name=Frame23 noresize scrolling=no marginwidth=0 marginheight=0> <frame src="about:blank" name=Frame24 noresize scrolling=no marginwidth=0 marginheight=0> <frame src="about:blank" name=Frame25 noresize scrolling=no marginwidth=0 marginheight=0> <frame src="about:blank" name=Frame26 noresize scrolling=no marginwidth=0 marginheight=0> <frame src="about:blank" name=Frame27 noresize scrolling=no marginwidth=0 marginheight=0> <frame src="about:blank" name=Frame28 noresize scrolling=no marginwidth=0 marginheight=0> <frame src="about:blank" name=Frame29 noresize scrolling=no marginwidth=0 marginheight=0> </frameset> <frameset rows="*,*,*,*,*,*,*,*,*,*" border=0 frameborder=no> <frame src="about:blank" name=Frame30 noresize scrolling=no marginwidth=0 marginheight=0> <frame src="about:blank" name=Frame31 noresize scrolling=no marginwidth=0 marginheight=0> <frame src="about:blank" name=Frame32 noresize scrolling=no marginwidth=0 marginheight=0> <frame src="about:blank" name=Frame33 noresize scrolling=no marginwidth=0 marginheight=0> <frame src="about:blank" name=Frame34 noresize scrolling=no marginwidth=0 marginheight=0> <frame src="about:blank" name=Frame35 noresize scrolling=no marginwidth=0 marginheight=0> <frame src="about:blank" name=Frame36 noresize scrolling=no marginwidth=0 marginheight=0> <frame src="about:blank" name=Frame37 noresize scrolling=no marginwidth=0 marginheight=0> <frame src="about:blank" name=Frame38 noresize scrolling=no marginwidth=0 marginheight=0> <frame src="about:blank" name=Frame39 noresize scrolling=no marginwidth=0 marginheight=0> </frameset> </frameset> <noframes> <center> Sorry! The speed measurement only works if your browser supports frames. </noframes> </frameset> </html> --------------------------------------------------------------------- Copy and Paste in Note pad or any txt editor and save with Html Extension. connect the net and double click on it. Here you Done..!! __________________ |
|
#4
| ||||
| ||||
|
Long Code After you save do you upload it because its on the site somewhere.
__________________ My iPhone is better than yours........... I Am Back! |
|
#5
| ||||
| ||||
|
no.. we do not have to upload it, but definitely have to be online and execute the file in our local PC
__________________ Would you like to Link To Us | Support TECH6 by going Premium Know more about me at Vinayaks.com | Follow TECH6 at Twitter |
![]() |
| Bookmarks |
| Thread Tools | |
| Display Modes | |
| |