PDA

Просмотр полной версии : Проблемка с скриптами


senson
20.03.2005, 03:04
Помогите!!!
Не могут ужиться ява скрипты....точнее голосование и часы...как это исправить.....голосование должно открываться в новом окне по нажатию на кнопку голосовать а этого не происходит (а оно не засчитывает голоса(число проголосовавших стоит на 141 человеках. (просто скрипт этот работал норма без часов а часы очень нужны))).....страница просто обновляеться...
вот код всей страницы...сама траница лежит здесь http://www.kikya.spacend.info/why.htm

Зарание ОГРОМНОЕ СПАСИБО
Код страницы:
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=windows-1251">
<meta http-equiv="Content-Language" content="ru">
<title></title>
</head>

<body onLoad="startBanner();StartClock();" bgcolor="#000000">

<table border="0" width="890" height="793" cellspacing="0" cellpadding="0">
<tr>
<td height="12" width="890" colspan="3"><font size="1" color="#000000"></font></td>
</tr>
<tr>
<td height="731" width="157" rowspan="3">
</td>
<td height="648" width="568">
<font color="#00DD00">Почему не работает голосование,мне кажеться скрипт
часов не даёт проголосовать по нажатию на кнопку голосовать должно
открыться отдельное окно с результатами...а оно даже голосовать не
хочет.....
</font>
<div style="position: absolute; width: 57px; height: 41px; z-index: 12; left: 484px; top: 97px" id="layer2">
<script language="JavaScript"><!--

var clockID = 0;
var speed = 100 // decrease value to increase speed (must be positive)
var pause = 3000 // increase value to increase pause
var timerID = null
var bannerRunning = false
var ar = new Array()
// Здесь вы вводите свой текст
ar[0] = "|||Сайт |||"
ar[1] = "Да-да а вот это бегущая строка!!!"
var currentMessage = 0
var offset = 0
function stopBanner() {
if (bannerRunning)
clearTimeout(timerID)
bannerRunning = false
}
function UpdateClock() {
if(clockID) {
clearTimeout(clockID);
clockID = 0;
}

var tDate = new Date();

document.clock.time.value = ""
+ tDate.getHours() + ":"
+ tDate.getMinutes() + ":"
+ tDate.getSeconds();

clockID = setTimeout("UpdateClock();", 1000);
}
function StartClock() {
clockID = setTimeout("UpdateClock();", 500);
}

function KillClock() {
if(clockID) {
clearTimeout(clockID);
clockID = 0;
}
}

function startBanner() {
stopBanner()

showBanner()
}
function showBanner() {
var text = ar[currentMessage]
if (offset < text.length) {
if (text.charAt(offset) == " ")
offset++
var partialMessage = text.substring(0, offset + 1)
window.status = partialMessage
offset++ // IE sometimes has trouble with "++offset"
timerID = setTimeout("showBanner()", speed)
bannerRunning = true
} else {
offset = 0
currentMessage++
if (currentMessage == ar.length)
currentMessage = 0
timerID = setTimeout("showBanner()", pause)
bannerRunning = true
}
}
// -->
</script>

<form name="clock">
<input type="text" name="time" size=6 style="color: #FF0000; font-weight: bold; border: 1px solid #000000; padding-left: 4px; padding-right: 4px; padding-top: 1px; padding-bottom: 1px; background-color: #000000">
<form></div>
</td>
<td height="709" width="181" rowspan="3" valign="top"><form action="http://www.ox.ru/cgi-bin/vote.pl" method="POST" target="_blank">
<input type="hidden" name="id" value="518717">
<table bgcolor="#000000" width="143">
<tr>
<td align="center" valign="top"><font color="#FFFFFF">Голосование?</font></td>
</tr>
<tr>
<td valign="top"><font color="#BFBFBF"><input type="radio" name="vote" value="1">ответ<br>
<input type="radio" name="vote" value="2">ответ2<br>
<input type="radio" name="vote" value="3">ответ3<br>
</font></td>
</tr>
<tr>
<td align="center" valign="top" height="58"><br>
<input type="submit" value="Голосовать"><br>
<a href="http://www.ox.ru/cgi-bin/vote.pl?action=show&id=518717" target="_blank">Результаты</a></td>
</tr>
</table>
</form>
<!--voting from BULLET end -->
</td>
</tr>
<tr>
<td height="42" width="554">
</td>
</tr>
<tr>
<td height="19" width="554"> </td>
</tr>
</table></body></html>

Sheryld
20.03.2005, 10:47
ошибка:

<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=windows-1251">
<meta http-equiv="Content-Language" content="ru">
<title></title>
</head>

<body onLoad="startBanner();StartClock();" bgcolor="#000000">

<table border="0" width="890" height="793" cellspacing="0" cellpadding="0">
<tr>
<td height="12" width="890" colspan="3"><font size="1" color="#000000"></font></td>
</tr>
<tr>
<td height="731" width="157" rowspan="3">
</td>
<td height="648" width="568">
<font color="#00DD00">Почему не работает голосование,мне кажеться скрипт
часов не даёт проголосовать по нажатию на кнопку голосовать должно
открыться отдельное окно с результатами...а оно даже голосовать не
хочет.....
</font>
<div style="position: absolute; width: 57px; height: 41px; z-index: 12; left: 484px; top: 97px" id="layer2">
<script language="JavaScript"><!--

var clockID = 0;
var speed = 100 // decrease value to increase speed (must be positive)
var pause = 3000 // increase value to increase pause
var timerID = null
var bannerRunning = false
var ar = new Array()
// Здесь вы вводите свой текст
ar[0] = "|||Сайт |||"
ar[1] = "Да-да а вот это бегущая строка!!!"
var currentMessage = 0
var offset = 0
function stopBanner() {
if (bannerRunning)
clearTimeout(timerID)
bannerRunning = false
}
function UpdateClock() {
if(clockID) {
clearTimeout(clockID);
clockID = 0;
}

var tDate = new Date();

document.clock.time.value = ""
+ tDate.getHours() + ":"
+ tDate.getMinutes() + ":"
+ tDate.getSeconds();

clockID = setTimeout("UpdateClock();", 1000);
}
function StartClock() {
clockID = setTimeout("UpdateClock();", 500);
}

function KillClock() {
if(clockID) {
clearTimeout(clockID);
clockID = 0;
}
}

function startBanner() {
stopBanner()

showBanner()
}
function showBanner() {
var text = ar[currentMessage]
if (offset < text.length) {
if (text.charAt(offset) == " ")
offset++
var partialMessage = text.substring(0, offset + 1)
window.status = partialMessage
offset++ // IE sometimes has trouble with "++offset"
timerID = setTimeout("showBanner()", speed)
bannerRunning = true
} else {
offset = 0
currentMessage++
if (currentMessage == ar.length)
currentMessage = 0
timerID = setTimeout("showBanner()", pause)
bannerRunning = true
}
}
// -->
</script>

<form name="clock">
<input type="text" name="time" size=6 style="color: #FF0000; font-weight: bold; border: 1px solid #000000; padding-left: 4px; padding-right: 4px; padding-top: 1px; padding-bottom: 1px; background-color: #000000">
</form></div>
</td>
<td height="709" width="181" rowspan="3" valign="top"><form action="http://www.ox.ru/cgi-bin/vote.pl" method="POST" target="_blank">
<input type="hidden" name="id" value="518717">
<table bgcolor="#000000" width="143">
<tr>
<td align="center" valign="top"><font color="#FFFFFF">Голосование?</font></td>
</tr>
<tr>
<td valign="top"><font color="#BFBFBF"><input type="radio" name="vote" value="1">ответ<br>
<input type="radio" name="vote" value="2">ответ2<br>
<input type="radio" name="vote" value="3">ответ3<br>
</font></td>
</tr>
<tr>
<td align="center" valign="top" height="58"><br>
<input type="submit" value="Голосовать"><br>
<a href="http://www.ox.ru/cgi-bin/vote.pl?action=show&id=518717" target="_blank">Результаты</a></td>
</tr>
</table>
</form>
<!--voting from BULLET end -->
</td>
</tr>
<tr>
<td height="42" width="554">
</td>
</tr>
<tr>
<td height="19" width="554"> </td>
</tr>
</table></body></html>

senson
21.03.2005, 01:19
Да работает!!! спасибо!!!!
форму закрыл как сказал:
<form name="clock">
<input type="text" name="time" size=6 style="color: #FF0000; font-weight: bold; border: 1px solid #000000; padding-left: 4px; padding-right: 4px; padding-top: 1px; padding-bottom: 1px; background-color: #000000">
</form></div>
Да но после голосования стоит опять тег: </form>
<a href="http://www.ox.ru/cgi-bin/vote.pl?action=show&id=518717" target="_blank">Результаты</a></td>
</tr>
</table>
</form>
<!--voting from BULLET end -->

Хотя он не открывался опять....мож его просто убрать хотя и так тоже всё работает...как лучше?