|
 |
Enjoy an ad free experience by logging in. Not a member yet? Register.
|
|
|
|
07-12-2012, 03:23 PM
|
PM User |
#1
|
|
New Coder
Join Date: Dec 2011
Posts: 18
Thanks: 0
Thanked 0 Times in 0 Posts
|
Script dont work HELP HERE!!!
I am looking why my script isn't working. I couldn't figure/find resources about it. My problem is that the script doesn't work somehow in my blog.
Here's my test wordpress site and if you click on the buttons then there is no response.
http://test.blogg-in.com/
Here's the script/code:
Code:
<center><input style="width:110px; height:30px;" type="button" id='https://www.google.de/' value="Link 1" onClick="enable(this,1);this.onclick = function(){ enable(this,0) };"></center>
<center><input style="width:110px; height:30px;" type="button" id='https://www.google.de/' value="Link 2" onClick="enable(this,1);this.onclick = function(){ enable(this,0) };"></center>
<center><input style="width:110px; height:30px;" type="button" id='https://www.google.de/' value="Link 3" onClick="enable(this,1);this.onclick = function(){ enable(this,0) };"></center>
<center><input style="width:110px; height:30px;" type="button" id='https://www.google.de/' value="Link 4" onClick="enable(this,1);this.onclick = function(){ enable(this,0) };"></center>
<center><input style="width:110px; height:30px;" type="button" id='https://www.google.de/' value="Link 5" onClick="enable(this,1);this.onclick = function(){ enable(this,0) };"></center>
<center><input style="width:110px; height:30px;" type="button" id='https://www.google.de/' value="Link 6" onClick="enable(this,1);this.onclick = function(){ enable(this,0) };"></center>
<center><input style="width:110px; height:30px;" type="button" id='https://www.google.de/' value="Link 7" onClick="enable(this,1);this.onclick = function(){ enable(this,0) };"></center>
<center><input style="width:110px; height:30px;" type="button" id='https://www.google.de/' value="Link 8" onClick="enable(this,1);this.onclick = function(){ enable(this,0) };"></center>
<center><input style="width:110px; height:30px;" type="button" id='https://www.google.de/' value="Link 9" onClick="enable(this,1);this.onclick = function(){ enable(this,0) };"></center>
<center><input style="width:110px; height:30px;" type="button" id='https://www.google.de/' value="Link 10" onClick="enable(this,1);this.onclick = function(){ enable(this,0) };"></center>
<center><input style="width:110px; height:30px;" type="button" id='https://www.google.de/' value="Link 11" onClick="enable(this,1);this.onclick = function(){ enable(this,0) };"></center>
<center><input style="width:110px; height:30px;" type="button" id='https://www.google.de/' value="Link 12" onClick="enable(this,1);this.onclick = function(){ enable(this,0) };"></center>
<script type="text/javascript">
var clicks=0;
function goThere() {
window.location = "http://www.youtube.com/";
}
function enable(butt,count){
window.open(butt.id,'pwin','location=no,status=no,scrollbars=no,resizeable=yes,toolbar=no')
clicks+=count;
if (clicks==6){
thebutt=document.getElementById("key")
thebutt.disabled=false;
thebutt.value="Unlocked";
}
}
</script>
<center><input style="width:110px; height:30px;" type="button" value="Locked" id="key" disabled="true" onclick = "goThere()"></center>
|
|
|
|
07-12-2012, 04:05 PM
|
PM User |
#2
|
|
The fat guy next door

Join Date: Jan 2006
Location: Halle (Saale), Germany
Posts: 7,613
Thanks: 5
Thanked 865 Times in 842 Posts
|
Learn to use the error console built into most browsers nowadays. The first thing I get when I load your page is:
Quote:
Error: syntax error
Source: http://test.blogg-in.com/
Line: 125, Column: 13
Source code:
var clicks=0;</p>
|
And when I click a button it says:
And when I look in the source code I see:
Code:
<p><script type="text/javascript">
var clicks=0;</p>
<p>function goThere() {
window.location = "http://www.wix.com/worldwidedownloads/ninja-saga-gold-tokens";
}</p>
<p>function enable(butt,count){
window.open(butt.id,'pwin','location=no,status=no,scrollbars=no,resizeable=yes,toolbar=no')
clicks+=count;
if (clicks==6){
thebutt=document.getElementById("key")
thebutt.disabled=false;
thebutt.value="Unlocked";
}
}
</script></p>
__________________
Don’t click this link!
|
|
|
07-12-2012, 05:47 PM
|
PM User |
#3
|
|
New Coder
Join Date: Dec 2011
Posts: 18
Thanks: 0
Thanked 0 Times in 0 Posts
|
ok how do i fix this ?
|
|
|
07-12-2012, 06:13 PM
|
PM User |
#4
|
|
Regular Coder
Join Date: Sep 2002
Posts: 216
Thanks: 0
Thanked 11 Times in 11 Posts
|
Looks like your blog site uses line returns to determine new paragraphs, so remove the line returns.
Code:
<script type="text/javascript">var clicks=0;function goThere(){window.location="http://www.wix.com/worldwidedownloads/ninja-saga-gold-tokens";};function enable(butt,count){window.open(butt.id,'pwin','location=no,status=no,scrollbars=no,resizeable=yes,toolbar=no');clicks+=count;if(clicks==6){thebutt=document.getElementById("key");thebutt.disabled=false;thebutt.value="Unlocked";}}</script>
Also known as 'compressing code'.
__________________
NO Limits!!
|
|
|
07-12-2012, 11:19 PM
|
PM User |
#5
|
|
New Coder
Join Date: Dec 2011
Posts: 18
Thanks: 0
Thanked 0 Times in 0 Posts
|
Thank youuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuu:d:d:d:d:d:d:d:d:d:d:d:d:d:d:d
|
|
|
 |
Jump To Top of Thread
| Thread Tools |
|
|
| Rate This Thread |
|
|
Posting Rules
|
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
HTML code is Off
|
|
|
All times are GMT +1. The time now is 11:02 PM.
|
Advertisement Log in to turn off these ads. |
|
|
|
|
|
|
|
|
|
|