object expected..
jeg har kikket på scriptet utallige gange og kan stadig ikke finde fejlen.. jeg har søgt på google og her på eksperten, men uden held..jeg får den kendte 'object expected' fejl i linje 174, altså:
<body onload="combin();">
scripted er nok ikke særlig pænt skrevet, da det gik lidt stærkt (muligvis også grunden til denne fejl)..
her er scriptet.. (langt):
<html>
<head>
<script language="javascript">
<!--
function wstatus(tyear, tday, thour, tmin, tsec, tmsec, id)
{
//var txt = "";
//if (tyear == 1)
//{
// txt = txt+tyears+" year ";
//} else {
// txt = txt+tyears+" years ";
//}
writeLayer(id, tyear + " years " + tday + " days " + thour + " hours " + tmin + " minutes " + tsec + " seconds " + tmsec + " miliseconds";
//if (tyear <= 1)
//{
// writeLayer("wstatus", "hej");
//}
//return true;
}
function combin()
{
var lower = false;
var upper = false;
var numbe = false;
var charn = false;
var charo = false;
var combi = 0;
var pass = self.document.passform.pass.value;
var tmp = "";
var tmpasc = 0;
if (pass == "")
{
var txt = "0 years 0 days 0 hours 0 minutes 0 seconds 0 miliseconds";
writeLayer("0comp", txt);
writeLayer("1comp", txt);
writeLayer("3comp", txt);
writeLayer("5comp", txt);
writeLayer("7comp", txt);
writeLayer("9comp", txt);
writeLayer("seticomp", txt);
return false;
}
for(var i=0; i<pass.length; i++) {
tmp = pass.charAt(i);
tmpasc = pass.charCodeAt(i);
if ((tmpasc >= 97) && (tmpasc <= 122))
{
lower = true;
}
else if ((tmpasc >= 65) && (tmpasc <= 90))
{
upper = true;
}
else if ((tmpasc >= 48) && (tmpasc <= 57))
{
numbe = true;
}
else if ((((tmp == "-") || (tmp == "_")) || ((tmp == "+") || (tmp == "@"))) || (((tmp == ",") || (tmp == ";")) || ((tmp == ".") || (tmp == ":"))))
{
charn = true;
}
else
{
charo = true;
}
tmp = "";
}
if (lower == true)
{
combi += 25;
}
if (upper == true)
{
combi += 25;
}
if (numbe == true)
{
combi += 10;
}
if (charn == true)
{
combi += 8;
}
if (charo == true)
{
combi = 256;
}
var logcombi = pass.length * Math.log(combi) / Math.log(10);
logcombi0 = logcombi - (Math.log(2000) + Math.log(1)) / Math.log(10);
logcombi1 = logcombi - (Math.log(2000) + Math.log(10)) / Math.log(10);
logcombi3 = logcombi - (Math.log(2000) + Math.log(1000)) / Math.log(10);
logcombi5 = logcombi - (Math.log(2000) + Math.log(100000)) / Math.log(10);
logcombi7 = logcombi - (Math.log(2000) + Math.log(10000000)) / Math.log(10);
logcombi9 = logcombi - (Math.log(2000) + Math.log(1000000000)) / Math.log(10);
logcombiseti = logcombi - (Math.log(2000) + Math.log(4541466)) / Math.log(10);
cstime(logcombi0, "0comp");
cstime(logcombi1, "1comp");
cstime(logcombi3, "3comp");
cstime(logcombi5, "5comp");
cstime(logcombi7, "7comp");
cstime(logcombi9, "9comp");
cstime(logcombiseti, "seticomp");
}
function cstime(logcombi, id)
{
var tyear = 0, tday = 0;
var thour = 0, tmin = 0, tsec = 0, tmsec = 0;
if (logcombi > (10 + (Math.log(60) + Math.log(60) + Math.log(24) + Math.log(356))))
{
writeLayer(id, "More than 10 billion years !!");
return false;
}
tyear = Math.pow(10, logcombi) / (60 * 60 * 24 * 365);
tday = (tyear - Math.round(tyear - 0.5)) * 365;
tyear -= (tyear - Math.round(tyear - 0.5));
thour = (tday - Math.round(tday - 0.5)) * 24;
tday -= (tday - Math.round(tday - 0.5));
tmin = (thour - Math.round(thour - 0.5)) * 60;
thour -= (thour - Math.round(thour - 0.5));
tsec = (tmin - Math.round(tmin - 0.5)) * 60;
tmin -= (tmin - Math.round(tmin - 0.5));
tmsec = Math.round((tsec - Math.round(tsec - 0.5)) * 1000);
tsec -= (tsec - Math.round(tsec - 0.5));
if (tmsec >= 1000)
{
tmsec -= 1000;
tsec += 1;
}
wstatus(tyear, tday, thour, tmin, tsec, tmsec, id);
}
function writeLayer(layerID,txt)
{
document.getElementById(layerID).innerHTML=txt;
}
//-->
</script>
</head>
<body onload="combin();">
<table style='border: 0px solid #000000;' cellpadding='0' cellspacing='0'>
<tr width='800'>
<td width='200' style='border: 1px solid #000000'>10^0 computers [2ghz]</td>
<td width='600' id='0comp' style='border: 1px solid #000000' align='right'> </td>
</tr>
<tr width='800'>
<td width='200' style='border: 1px solid #000000'>10^1 computers [2ghz]</td>
<td width='600' id='1comp' style='border: 1px solid #000000' align='right'> </td>
</tr>
<tr width='800'>
<td width='200' style='border: 1px solid #000000'>10^3 computers [2ghz]</td>
<td width='600' id='3comp' style='border: 1px solid #000000' align='right'> </td>
</tr>
<tr width='800'>
<td width='200' style='border: 1px solid #000000'>10^5 computers [2ghz]</td>
<td width='600' id='5comp' style='border: 1px solid #000000' align='right'> </td>
</tr>
<tr width='800'>
<td width='200' style='border: 1px solid #000000'>10^7 computers [2ghz]</td>
<td width='600' id='7comp' style='border: 1px solid #000000' align='right'> </td>
</tr>
<tr width='800'>
<td width='200' style='border: 1px solid #000000'>10^9 computers [2ghz]</td>
<td width='600' id='9comp' style='border: 1px solid #000000' align='right'> </td>
</tr>
</table>
<br>
<table style='border: 0px solid #000000;' cellpadding='0' cellspacing='0'>
<tr width='800'>
<td width='200' style='border: 1px solid #000000'>Seti - 5 * 10^6 [2ghz]</td>
<td width='600' id='seticomp' style='border: 1px solid #000000' align='right'> </td>
</tr>
</table>
<form name='passform' action='' method='post'>
<table cellpadding='0' cellspacing='0'>
<tr>
<td><input type='password' name='pass' onkeypress='combin();' style='border: 1px solid #000000; height: 20px; width: 250px;'></td>
<td width='10px'></td>
<td><div id='id_status'>Your password is not secure !!</div></td>
</tr>
</table>
<input type='text' name='mhz' onkeyup='combin();' style='border: 1px solid #000000; height: 20px; width: 250px;'>
<input type='submit' value='submit' style='border: 1px solid #000000; height: 20px;'>
</form>
