Nicht valide - 1 Fehler

K

konrad2006

Mitglied
Thread Starter
Dabei seit
21.10.2005
Beiträge
40
Reaktionspunkte
0
... und es liegt an einem dynamic drive formular. Wer kann mir helfen den einen Fehler zu beseitigen?

Fehlermeldung:

Error Line 43 column 23: end tag for element "STYLE" which is not open.

document.write('</style>\n')

The Validator found an end tag for the above element, but that element is not currently open. This is often caused by a leftover end tag from an element that was removed during editing, or by an implicitly closed element (if you have an error related to an element being used where it is not allowed, this is almost certainly the case). In the latter case this error will disappear as soon as you fix the original problem.

If this error occured in a script section of your document, you should probably read this FAQ entry

Der Quellcode:
<script type="text/javascript">

/*
Combo-Box Viewer script- Created by and Dynamicdrive.com
Visit http://www.dynamicdrive.com/ for this script and more
This notice MUST stay intact for legal use
*/

if (document.getElementById){
document.write('<style type="forum/default.css">\n')
document.write('.dropcontent{display:none;}\n')
document.write('</style>\n')
}


function contractall(){
if (document.getElementById){
var inc=0
while (document.getElementById("dropmsg"+inc)){
document.getElementById("dropmsg"+inc).style.display="none"
inc++
}
}
}

function expandone(){
if (document.getElementById){
var selectedItem=document.dropmsgform.dropmsgoption.selectedIndex
contractall()
document.getElementById("dropmsg"+selectedItem).style.display="block"
}
}

if (window.addEventListener)
window.addEventListener("load", expandone, false)
else if (window.attachEvent)
window.attachEvent("onload", expandone)

</script>

Was muss ich da ändern? DANKE FÜR EURE HILFE!!!
 
Diese Zeile
document.write('<style type="forum/default.css">\n')
sollte wohl eher so
document.write('<style type="text/css">\n')
aussehen.

Eine StyleSheet Datei bindet man mit link oder per import ein.
(siehe weiterführende Seiten unter obigem Link von catvarlog)

Aber ob das jetzt wirklich der Fehler war, weiss ich nicht. Probier's mal aus.
 
Schade,

das war es leider nicht. Danke für die Müh. Wenns noch weitere Ideen gibt...
 
Zum debuggen von javascript ist Firefox optimal! Der Debugger erlöst einem von den astrologischen Fehlermeldungen aus Webbrowsern und Validatoren. Vielleicht siehst Du da dann mehr.
 
Hallo wegus,

danke für den Tip. Nur ich bin auf dem Gebiet noch zu grün hinter den Ohren - mit dem Debugger komm ich überhaupt nicht klar. vermutlich muss ich es wohl so lassen...
 
Zurück
Oben Unten