PDA

View Full Version : Plz Help me with my javascript.


Bazrah
04-30-2003, 05:11 PM
Content:

All 5 mins a random link of a list will be opened and disabled right click.

Problem:

The 5min Counter isn't displayed correctly as u can see on
www.freewebs.com/icebuilder1

The Script:

<!doctype html public "-//IETF//DTD HTML 2.0//EN">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<meta name="Generator" content="Microsoft Publisher 2000">
<title>The Ice-Thugbuilder v1.0 &copy 2003 by Bazrah</title>
</head>
<body bgcolor="#000000" link="#0066ff" vlink="#6633cc" text="#000000" topmargin=0 leftmargin=0>
<a name=top></a>

<table border=0 cellpadding=0 cellspacing=0>
<tr>
<td><img src="_blnk.gif" width=132 height=1></td>
<td><img src="_blnk.gif" width=75 height=1></td>
<td><img src="_blnk.gif" width=218 height=1></td>
<td><img src="_blnk.gif" width=47 height=1></td>
<td><img src="_blnk.gif" width=37 height=1></td>
<td><img src="_blnk.gif" width=19 height=1></td>
<td><img src="_blnk.gif" width=38 height=1></td>
</tr>
<tr>
<td width=132 height=94></td>
<td width=75></td>
<td width=218></td>
<td width=47></td>
<td width=37></td>
<td width=19></td>
<td width=38></td>
</tr>
<tr>
<td height=170></td>
<td></td>
<td width=218 height=189 colspan=1 rowspan=2 valign=top align=left>
<!-- HTML Markup startspan -->
<script>

//Pop-under window- By JavaScript Kit
//Credit notice must stay intact for use
//Visit http://javascriptkit.com for this script

//specify URLs to randomly select from and pop-under
var popunder=new Array()
popunder[0]="http://www.***********/page.php?x=796910"
popunder[1]="http://www.***********/page.php?x=700832"
popunder[2]="http://www.***********/page.php?x=716099"








var winfeatures="width=800,height=510,scrollbars=1,resizable=1,toolbar=1,location=1,menubar=1,status=1,directories=1"

var once_per_session=0


function get_cookie(Name) {
var search = Name + "="
var returnvalue = "";
if (document.cookie.length > 0) {
offset = document.cookie.indexOf(search)
if (offset != -1) { // if cookie exists
offset += search.length
// set index of beginning of value
end = document.cookie.indexOf(";", offset);
// set index of end of cookie value
if (end == 350)
end = document.cookie.length;
returnvalue=unescape(document.cookie.substring(offset, end))
}
}
return returnvalue;
}

function loadornot(){
if (get_cookie('popunder')==''){
loadpopunder()
document.cookie="popunder=no"
}
}

function loadpopunder(){
win2=window.open(popunder[Math.floor(Math.random()*(popunder.length))],"",winfeatures)
win2.blur()
window.focus()
}

if (once_per_session==0)
loadpopunder()
else
loadornot()

</script>
<!-- HTML Markup endspan -->


</td>
<td colspan=4></td>
</tr>
<tr>
<td height=19></td>
<td></td>
<td colspan=3></td>
<td width=38 height=66 colspan=1 rowspan=3 valign=top align=left>
<!-- HTML Markup startspan -->

<script language="JavaScript"><!--
function click(){if (event.button==2){alert('Ice-Thugbuilder v1.0 © 2003 by Bazrah, If you want your own builder give me 5 points!')}}document.onmousedown=click// -->
</script>

<!-- HTML Markup endspan -->


</td>
</tr>
<tr>
<td height=38></td>
<td colspan=5></td>
</tr>
<tr>
<td height=9></td>
<td width=340 height=113 colspan=3 rowspan=3 valign=top align=left>
<!-- HTML Markup startspan -->
<html>
<head><title>Connection Refresher JavaScript</title>
</head>
<body>
<script language="JavaScript">
<!--
//***This Header Must Remain Attached ********** You May Not Remove Or Alter This Header*******
//Connection Refresher Javascript© by John Farquharson daworxwebdesign@yahoo.com *
//Completed Sun Sept 22 MMII @ 8:09 A.M. EDST Copyright DaWorx Web Design® MMII (2002) *
//Author continues to hold all rights to ownership of this JavaScript - copyright 2002 (MMII) *
//This script is Linkware. DaWorx link must remain on this script and visible on the page. *
//Works in IE 5.5 / Netscape 4.6 - 6.1 / Opera 6.0 - May function with other browsers *
//***This Header Must Remain Attached ********** You May Not Remove Or Alter This Header*******
document.writeln("<form name='my_form' action=''><table border='1' bordercolor='#0000FF' bgcolor='#FFFFFF' cellpadding='5' cellspacing='0' width='200'><tr><td><center><font size='1' face='verdana'><input type='text' name='my_text' size='35'></font><br><font size='1' face='verdana' color='#0000FF'> <br> <a href=''><font color='#0000FF'> </font></a></font></center></tr></td></table></form>");// You may not remove/alter my link on this line or color the page background or use any other method so as to obscure my link from view
var the_minutes = [ " 4", " 3", " 2", " 1", " 0" ] ;// ** add/remove quoted numbers in this line to increase/decrease page reload time - currently set to begin at 4 minutes 59 seconds
var the_seconds = [ "59", "58", "57", "56", "55", "54", "53", "52", "51", "50", "49", "48", "47", "46", "45", "44", "43", "42", "41", "40", "39", "38", "37", "36", "35", "34", "33", "32", "31", "30", "29", "28", "27", "26", "25", "24", "23", "22", "21", "20", "19", "18", "17", "16", "15", "14", "13", "12", "11", "10", "09", "08", "07", "06", "05", "04", "03", "02", "01", "00" ];
var index = 0;
var a = 0;
var my_timer;
function countDown(){
if (index <= the_seconds.length){window.document.my_form.my_text.value = " Serving next user in" + the_minutes[a] + ":" + the_seconds[index] + " Minutes"; index++;};
if (index == the_seconds.length){a++; index = "0";};
if (a == the_minutes.length){window.location.reload()};
my_timer = setTimeout('countDown();', 1000)};
countDown();
//-->
</script>
</body>
</html>

<!-- HTML Markup endspan -->


</td>
<td colspan=2></td>
</tr>
<tr>
<td height=29></td>
<td colspan=3></td>
</tr>
<tr>
<td height=75></td>
<td></td>
<td width=57 height=103 colspan=2 rowspan=2 valign=top align=left>
<!-- HTML Markup startspan -->
<script>
<!--

/*
Break-out-of-frames script
By JavaScript Kit (http://javascriptkit.com)
Over 400+ free scripts here!
Above notice MUST stay entact for use
*/

if (window!= top)
top.location.href=location.href
// -->
</script>
<!-- HTML Markup endspan -->


</td>
</tr>
<tr>
<td height=28></td>
<td colspan=4></td>
</tr>
</table>

<a name=bottom></a>
</body>
</html>

beetle
04-30-2003, 05:30 PM
What you posted above is different from the actual HTML of the page you linked to. The problem is in this line (I'm not pasting the whole thing, only enough to encompass the problem area)document.writeln("<H3>This form is inoperational!</H3> <Provisional users can't create forms name='my_form' action=''>Needs to be changed todocument.writeln("<H3>This form is inoperational!</H3> Provisional users can't create forms <form name='my_form' action=''>

Bazrah
04-30-2003, 06:40 PM
The content is really diffrent?
No matter, thanks for your help!

Bazrah
04-30-2003, 09:32 PM
That doesn't work, there must be another mistake

beetle
04-30-2003, 09:46 PM
Worked for me, I C & P'ed your HTML, changed that, and it worked like a charm on Mozilla and IE.

I think you need a better countdown script -- that one is bloated and looks kinda old.

Bazrah
05-01-2003, 08:33 AM
Maybe, you are right but where do i get a better countdown script?