Javascript geen object
Tikkes C
19/03/2009 13:59:00Hey iedereen
ik heb net iets geschreven in js maar telkens geeft hij dat er geen object wordt meegegeven...kan iemand de error vinden?
mijn JS
mijn html
ik heb net iets geschreven in js maar telkens geeft hij dat er geen object wordt meegegeven...kan iemand de error vinden?
mijn JS
Code (php)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
function $(id)
{
return document.getElementById(id);
}
//nakijken van de geklikte foto
function check(id)
{
if(totalShown() < 3)
{
show(id);
totalShown();
}
else if(totalShown() == 2)
{
if(first == second)
{
remove();
if(remove() >= 6)
{
$('span').innerHTML = "U heeft gewonnen in"+moves();
}
}
else
{
hide();
check(id);
}
}
}
{
return document.getElementById(id);
}
//nakijken van de geklikte foto
function check(id)
{
if(totalShown() < 3)
{
show(id);
totalShown();
}
else if(totalShown() == 2)
{
if(first == second)
{
remove();
if(remove() >= 6)
{
$('span').innerHTML = "U heeft gewonnen in"+moves();
}
}
else
{
hide();
check(id);
}
}
}
mijn html
Code (php)
1
2
3
4
5
6
7
8
2
3
4
5
6
7
8
<table>
<tr>
<td><img src="figuren/resultaat.jpg" id="1" alt="voorkant" onclick="check(this.id)"/></td>
<td><img src="figuren/resultaat.jpg" id="2" alt="voorkant" onclick="check(this.id)"/></td>
<td><img src="figuren/resultaat.jpg" id="3" alt="voorkant" onclick="check(this.id)"/></td>
<td><img src="figuren/resultaat.jpg" id="4" alt="voorkant" onclick="check(this.id)"/></td>
</tr>
<tr>
<td><img src="figuren/resultaat.jpg" id="1" alt="voorkant" onclick="check(this.id)"/></td>
<td><img src="figuren/resultaat.jpg" id="2" alt="voorkant" onclick="check(this.id)"/></td>
<td><img src="figuren/resultaat.jpg" id="3" alt="voorkant" onclick="check(this.id)"/></td>
<td><img src="figuren/resultaat.jpg" id="4" alt="voorkant" onclick="check(this.id)"/></td>
</tr>