code:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
| <script language="javascript" type="text/javascript"> sponsorstop = new Array(7); sponsorstop[0] = "<a href='http://www..be' ><img class='pics' src='images/sponsors_top/1.gif' alt='' /></a>"; sponsorstop[1] = "<a href='http://www..com' ><img class='pics' src='images/sponsors_top/2.gif' alt='' /></a>"; sponsorstop[2] = "<a href='http://www..be' ><img class='pics' src='images/sponsors_top/4.gif' alt='' /></a>"; sponsorstop[3] = "<a href='http://www..be' ><img class='pics' src='images/sponsors_top/5.gif' alt='' /></a>"; sponsorstop[4] = "<a href='http://www..be' ><img class='pics' src='images/sponsors_top/6.gif' alt='' /></a>"; sponsorstop[5] = "<img class='pics' src='images/sponsors_top/7.gif' alt='' />"; sponsorstop[6] = "<a href='http://www..be' ><img class='pics' src='images/sponsors_top/8.gif' alt='' /></a>"; index = Math.floor(Math.random() * sponsorstop.length); document.write(sponsorstop[index]); </script> |
code:
1
2
3
4
5
6
| Error Line 45, column 55: document type does not allow element "a" here . ...<a href='http://www..be' ><img class='pics' src='images/sponsors_ ✉ Error Line 47, column 76: document type does not allow element "img" here . ... src='images/sponsors_top/7.gif' alt='' />"; |
Dit is dus een javascript waar ik images in een webpagina laat weergeven (random) die hun sponsorlink bevat.
Ik heb dus alle fouten eruitgehaald volgens xthml1 transitional, behalve deze lukt mij niet. Bij elke lijn uit die javascript conflicteert hij. Nu zegt die w3c dat ik geen image of geen <a> erin mag steken. Ik kan toch moeilijk al die lijnen wissen, want dan ben ik die random sponsor bord kwijt.
hier ook een tekstje waarbij uitleg
Ik zou dus graag die randomlink met image behouden, maar is er een manier om die fout weg te krijgen. De webpagina werkt dus perfect, maar het is gewoon om w3C transitional valid te zijn.The element named above was found in a context where it is not allowed. This could mean that you have incorrectly nested elements -- such as a "style" element in the "body" section instead of inside "head" -- or two elements that overlap (which is not allowed).
One common cause for this error is the use of XHTML syntax in HTML documents. Due to HTML's rules of implicitly closed elements, this error can create cascading effects. For instance, using XHTML's "self-closing" tags for "meta" and "link" in the "head" section of a HTML document may cause the parser to infer the end of the "head" section and the beginning of the "body" section (where "link" and "meta" are not allowed; hence the reported error).