Ik heb het volgende stukje code.. Ik geef toe dat het wat onduidelijk lijkt zo, maar het is wel compacter..
Als ik dit stukje wil gebruiken krijg ik een foutmelding in IE.. eerst syntaxfout, nu krijg ik verwacht ';'
Om het allemaal beetje overzichtelijk te maken heb ik geprobeerd het bovenstaande een beetje duidelijk te structureren in een overzichtje:
Volgens mij klopt het echt gewoon voor 100% ? Kan misschien iemand helpen de fout te vinden
want ik heb me echt sufgezocht en kom er niet uit .. Misschien ergens een goede syntaxchecker online ?
JavaScript:
1
2
3
4
5
6
7
| strIets = (objEl.firstChild.lastChild.src.indexOf('T') > -1) ? (((bExpand == 1) || (bExpand == 0)) ? ((bExpand == 0) ? 'plusT' : ((objEl.lastChild.style.display == 'block') ? 'minT' : 'plusT')) : ((objEl.lastChild.style.display == 'block') ? 'minT' : 'plusT')) : (((bExpand == 1) || (bExpand == 0)) ? ((bExpand == 0) ? 'plusT' : ((objEl.lastChild.style.display == 'block') ? 'minT' : 'plusT')) : ((objEl.lastChild.style.display == 'block') ? 'minT' : 'plusT'))); |
Als ik dit stukje wil gebruiken krijg ik een foutmelding in IE.. eerst syntaxfout, nu krijg ik verwacht ';'
Om het allemaal beetje overzichtelijk te maken heb ik geprobeerd het bovenstaande een beetje duidelijk te structureren in een overzichtje:
HTML:
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
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
| (objEl.firstChild.lastChild.src.indexOf('T') > -1)
?
(
((bExpand == 1) || (bExpand == 0))
?
( (bExpand == 0)
?
'plusT'
:
( (objEl.lastChild.style.display == 'block')
?
'minT'
:
'plusT'
)
)
:
( (objEl.lastChild.style.display == 'block')
?
'minT'
:
'plusT'
)
)
:
( ((bExpand == 1) || (bExpand == 0))
?
( (bExpand == 0)
?
'plusT'
:
( (objEl.lastChild.style.display == 'block')
?
'minT'
:
'plusT'
)
)
:
( (objEl.lastChild.style.display == 'block')
?
'minT'
:
'plusT')
)
);
---------------------------------------------------------------------------------------------------
if (objEl.firstChild.lastChild.src.indexOf('T') > -1)
if ((bExpand == 1) || (bExpand == 0))
if (bExpand == 1) 'minT'
else
if (bExpand == 0) 'plusT'
else switch display 'minT' : 'plusT'
else switch display 'minT' : 'plusT'
else
if ((bExpand == 1) || (bExpand == 0))
if (bExpand == 1) 'minL'
else
if (bExpand == 0) 'plusL'
else switch display 'minL' : 'plusL'
else switch display 'minL' : 'plusL' |
Volgens mij klopt het echt gewoon voor 100% ? Kan misschien iemand helpen de fout te vinden
[ Voor 13% gewijzigd door r0bert op 02-02-2003 14:14 ]