Skocz do zawartości
Hosting webh.pl - 20%

[JS] problem ze skryptem ...

Rekomendowane odpowiedzi

Opublikowano

wiec tak mam skrypcik do votowania ...

ale jak go przerobilem to po kliknieciu nie chce sie odblokowac kolejny odnosik :)

np. klikam Klik 1 nie otwiera sie Klik 2

oto oryginalny dzialajacy kodzik:

<head> 
<body bgcolor=gray>
<div align="center"> 
<center> 
<table border="0" cellpadding="0" cellspacing="0" style="border-collapse: collapse" bordercolor="#111111" id="AutoNumber1" width="800" height="600" > 
  <tr> 
 <td><center> 
<img src="TUTAJ WKLEJ ADRES LOGA!">
</center><br><Br> 

<script> 
t = 5000; 
function timer1(){ 
setTimeout('adview.submit2.disabled = false' , t) 
} 
function vote1(){ 
window.open("ADRES TOPLISTY NR.1","glosuj","toolbar=no,height=400px,width=500px")
} 
function timer2(){ 
setTimeout('adview.submit4.disabled = false' , t) 
} 
function vote2(){ 
window.open("ADRES TOPLISTY NR.2","glosuj","toolbar=no,height=400px,width=500px")
} 
function timer3(){ 
setTimeout('adview.submit4.disabled = false' , t) 
} 
function vote3(){ 
window.open("http://gfgfgf.pl","glosuj","toolbar=no,height=400px,width=500px") 
} 
function go(){ 
self.location="ADRES FORUM, KTÓRE MA SIĘ WَCZYĆ PO TOPLISTACH";
} 
</script> 

<form name="adview"> 

 <p align="center"> 

<input style="border-style: solid; border-color: rgb(88, 88, 88); font-weight: bold; font-size: 10px; color: rgb(18, 18, 18); font-family: verdana; background-color: rgb(255, 179, 0);" 
onclick="timer1();vote1()" value="Głosowanie 1" name="submit1" 
type="button"><br> 
 <br> 
 <input style="border-style: solid; border-color: rgb(88, 88, 88); font-weight: bold; font-size: 10px; color: rgb(18, 18, 18); font-family: verdana; background-color: rgb(255, 179, 0);" 
disabled="disabled" onclick="timer2();vote2()" value="Głosowanie 2" 
name="submit2" type="button"><br> 
 <br> 
 <br> 
<input style="border-style: solid; border-color: rgb(88, 88, 88); font-weight: bold; font-size: 10px; color: rgb(18, 18, 18); font-family: verdana; background-color: rgb(255, 179, 0);" 
disabled="disabled" onclick="go()" value="WEJSCIE NA FORUM" name="submit4" 
type="button"></p> 

<br><b><FONT size=4>PRZYKŁADOWY TEKST(np.instrukcja jak zagłosować;))</FONT><b><br>

</td> 

</tr> 
</table> 
</div> 
</center> 

<body>

a oto przerobiony kodzik przezemnie:

<script> 
t = 5000; 
function timer1(){ 
setTimeout('adview.submit2.disabled = false' , t) 
} 
function vote1(){ 
window.open("http://onet.pl","glosuj","toolbar=no,height=400px,width=500px")
} 
function timer2(){ 
setTimeout('adview.submit4.disabled = false' , t) 
} 
function vote2(){ 
window.open("http://google.pl","glosuj","toolbar=no,height=400px,width=500px")
} 
function timer3(){ 
setTimeout('adview.submit4.disabled = false' , t) 
} 
function vote3(){ 
window.open("http://gfgfgf.pl","glosuj","toolbar=no,height=400px,width=500px") 
} 
function go(){ 
self.location="http://wp.pl";
} 
</script> 


<table border="0" cellpadding="0" cellspacing="0" style="border-collapse: collapse" bordercolor="#111111" id="AutoNumber1" width="800" height="600" > 
<table>
<tr>
<td width="x" height="y"><p align="center"> 

<input style="border-style: solid; border-color: rgb(88, 88, 88); font-weight: bold; font-size: 10px; color: rgb(18, 18, 18); font-family: verdana; background-color: rgb(255, 179, 0);" 
onclick="timer1();vote1()" value="Klik 1" name="submit1" 
type="button"><br> 
 <br> 
 <input style="border-style: solid; border-color: rgb(88, 88, 88); font-weight: bold; font-size: 10px; color: rgb(18, 18, 18); font-family: verdana; background-color: rgb(255, 179, 0);" 
disabled="disabled" onclick="timer2();vote2()" value="Klik 2" 
name="submit2" type="button"><br> 
 <br> 

<input style="border-style: solid; border-color: rgb(88, 88, 88); font-weight: bold; font-size: 10px; color: rgb(18, 18, 18); font-family: verdana; background-color: rgb(255, 179, 0);" 
disabled="disabled" onclick="go()" value="Part 1" name="submit4" 
type="button"></p> 
</td>	<td width="x" height="y"><p align="center"> 

<input style="border-style: solid; border-color: rgb(88, 88, 88); font-weight: bold; font-size: 10px; color: rgb(18, 18, 18); font-family: verdana; background-color: rgb(255, 179, 0);" 
onclick="timer1();vote1()" value="Klik 1" name="submit1" 
type="button"><br> 
 <br> 
 <input style="border-style: solid; border-color: rgb(88, 88, 88); font-weight: bold; font-size: 10px; color: rgb(18, 18, 18); font-family: verdana; background-color: rgb(255, 179, 0);" 
disabled="disabled" onclick="timer2();vote2()" value="Klik 2" 
name="submit2" type="button"><br> 
 <br> 

<input style="border-style: solid; border-color: rgb(88, 88, 88); font-weight: bold; font-size: 10px; color: rgb(18, 18, 18); font-family: verdana; background-color: rgb(255, 179, 0);" 
disabled="disabled" onclick="go()" value="Part 1" name="submit4" 
type="button"></p> 
</td>	<td width="x" height="y"><p align="center"> 

<input style="border-style: solid; border-color: rgb(88, 88, 88); font-weight: bold; font-size: 10px; color: rgb(18, 18, 18); font-family: verdana; background-color: rgb(255, 179, 0);" 
onclick="timer1();vote1()" value="Klik 1" name="submit1" 
type="button"><br> 
 <br> 
 <input style="border-style: solid; border-color: rgb(88, 88, 88); font-weight: bold; font-size: 10px; color: rgb(18, 18, 18); font-family: verdana; background-color: rgb(255, 179, 0);" 
disabled="disabled" onclick="timer2();vote2()" value="Klik 2" 
name="submit2" type="button"><br> 
 <br> 

<input style="border-style: solid; border-color: rgb(88, 88, 88); font-weight: bold; font-size: 10px; color: rgb(18, 18, 18); font-family: verdana; background-color: rgb(255, 179, 0);" 
disabled="disabled" onclick="go()" value="Part 1" name="submit4" 
type="button"></p> 
</td>	<td width="x" height="y"><p align="center"> 

<input style="border-style: solid; border-color: rgb(88, 88, 88); font-weight: bold; font-size: 10px; color: rgb(18, 18, 18); font-family: verdana; background-color: rgb(255, 179, 0);" 
onclick="timer1();vote1()" value="Klik 1" name="submit1" 
type="button"><br> 
 <br> 
 <input style="border-style: solid; border-color: rgb(88, 88, 88); font-weight: bold; font-size: 10px; color: rgb(18, 18, 18); font-family: verdana; background-color: rgb(255, 179, 0);" 
disabled="disabled" onclick="timer2();vote2()" value="Klik 2" 
name="submit2" type="button"><br> 
 <br> 

<input style="border-style: solid; border-color: rgb(88, 88, 88); font-weight: bold; font-size: 10px; color: rgb(18, 18, 18); font-family: verdana; background-color: rgb(255, 179, 0);" 
disabled="disabled" onclick="go()" value="Part 1" name="submit4" 
type="button"></p> 
</td>	<td width="x" height="y"><p align="center"> 

<input style="border-style: solid; border-color: rgb(88, 88, 88); font-weight: bold; font-size: 10px; color: rgb(18, 18, 18); font-family: verdana; background-color: rgb(255, 179, 0);" 
onclick="timer1();vote1()" value="Klik 1" name="submit1" 
type="button"><br> 
 <br> 
 <input style="border-style: solid; border-color: rgb(88, 88, 88); font-weight: bold; font-size: 10px; color: rgb(18, 18, 18); font-family: verdana; background-color: rgb(255, 179, 0);" 
disabled="disabled" onclick="timer2();vote2()" value="Klik 2" 
name="submit2" type="button"><br> 
 <br> 

<input style="border-style: solid; border-color: rgb(88, 88, 88); font-weight: bold; font-size: 10px; color: rgb(18, 18, 18); font-family: verdana; background-color: rgb(255, 179, 0);" 
disabled="disabled" onclick="go()" value="Part 1" name="submit4" 
type="button"></p> 
</td>	<td width="x" height="y"><p align="center"> 

<input style="border-style: solid; border-color: rgb(88, 88, 88); font-weight: bold; font-size: 10px; color: rgb(18, 18, 18); font-family: verdana; background-color: rgb(255, 179, 0);" 
onclick="timer1();vote1()" value="Klik 1" name="submit1" 
type="button"><br> 
 <br> 
 <input style="border-style: solid; border-color: rgb(88, 88, 88); font-weight: bold; font-size: 10px; color: rgb(18, 18, 18); font-family: verdana; background-color: rgb(255, 179, 0);" 
disabled="disabled" onclick="timer2();vote2()" value="Klik 2" 
name="submit2" type="button"><br> 
 <br> 

<input style="border-style: solid; border-color: rgb(88, 88, 88); font-weight: bold; font-size: 10px; color: rgb(18, 18, 18); font-family: verdana; background-color: rgb(255, 179, 0);" 
disabled="disabled" onclick="go()" value="Part 1" name="submit4" 
type="button"></p> 
</td>	<td width="x" height="y"><p align="center"> 

<input style="border-style: solid; border-color: rgb(88, 88, 88); font-weight: bold; font-size: 10px; color: rgb(18, 18, 18); font-family: verdana; background-color: rgb(255, 179, 0);" 
onclick="timer1();vote1()" value="Klik 1" name="submit1" 
type="button"><br> 
 <br> 
 <input style="border-style: solid; border-color: rgb(88, 88, 88); font-weight: bold; font-size: 10px; color: rgb(18, 18, 18); font-family: verdana; background-color: rgb(255, 179, 0);" 
disabled="disabled" onclick="timer2();vote2()" value="Klik 2" 
name="submit2" type="button"><br> 
 <br> 

<input style="border-style: solid; border-color: rgb(88, 88, 88); font-weight: bold; font-size: 10px; color: rgb(18, 18, 18); font-family: verdana; background-color: rgb(255, 179, 0);" 
disabled="disabled" onclick="go()" value="Part 1" name="submit4" 
type="button"></p> 
</td>
</tr>
</table>

Opublikowano
  • Manager

Hm, nie znam się na JS, ale na logikę patrząc to pierwszy kod musi działać i działa jak napisałeś..

Zobacz, analizując kod pierwszy:

onclick="timer1();vote1()"
onclick="timer2();vote2()"
onclick="go()"

Dlatego też Twój kod nie jest poprawny.

Musisz każdy kolejny button do naciśnięcia robić wg tego schematu i pamiętając by każdy kolejny miał ID o jeden więcej, czyli:

onclick="timer1();vote1()"
onclick="timer2();vote2()"
onclick="timer3();vote3()"
onclick="timer4();vote4()"

i tak dalej..

A na końcu:

onclick="go()"

Mam nadzieję, że mnie rozumiesz :)

intermedia - profesjonalne rozwiązania Invision Power Board, IC5

Opublikowano
  • Autor

kompletnie nie rozumiem ;/

znajac zycie mnie ktos pojedzie teraz za to co napisze ...

ale moglby ktos rozumiejacy to wklejic gotowy kod :) ??

wiem ze to glupie ale naprawde nie rozumiem tego ;/

i wielkie thx 4 you za pomoc !

Opublikowano

Znaczy się jeżeli dodasz samo:

  <input style="border-style: solid; border-color: rgb(88, 88, 88); font-weight: bold; font-size: 10px; color: rgb(18, 18, 18); font-family: verdana; background-color: rgb(255, 179, 0);"
disabled="disabled" onclick="timer2();vote2()" value="Klik 2"
name="submit2" type="button">

to nie za działa z racji że nie ma do tego odnośnika:

onclick="timer2();vote2()"

który znajduje się u góry.

In, and Out.

Ostatnio przeglądający 0

  • Brak zarejestrowanych użytkowników przeglądających tę stronę.

Szukaj

Szukaj

Skonfiguruj powiadomienia push w przeglądarce

Chrome (Android)
  1. Stuknij ikonę kłódki obok paska adresu.
  2. Stuknij Uprawnienia → Powiadomienia.
  3. Dostosuj swoje ustawienie.
Chrome (Komputer)
  1. Kliknij ikonę kłódki na pasku adresu.
  2. Wybierz Ustawienia witryny.
  3. Znajdź Powiadomienia i dostosuj swoje ustawienie.