mediengestalter.info
FAQ :: Mitgliederliste :: MGi Team

Willkommen auf dem Portal für Mediengestalter

Aktuelles Datum und Uhrzeit: Do 28.03.2024 13:01 Benutzername: Passwort: Auto-Login

Thema: JavaScript Problem mit Validator [erledigt] vom 13.03.2006


Neues Thema eröffnen   Neue Antwort erstellen MGi Foren-Übersicht -> Programmierung -> JavaScript Problem mit Validator [erledigt]
Autor Nachricht
xammm
Threadersteller

Dabei seit: 23.01.2006
Ort: Potsdam
Alter: 40
Geschlecht: Männlich
Verfasst Mo 13.03.2006 17:44
Titel

JavaScript Problem mit Validator [erledigt]

Antworten mit Zitat Zum Seitenanfang

EDIT: Erledigt, hab den JavaKram in eine js-Datei ausgelagert


Hallo,

folgender Code:

Code:

<script type="text/javascript">
var x = Zaehlerstand();
var y = "<table width='236' border='0' ........................ </tr></table>";

if (x == 1) y = "<img sr................................. alt=''>";

document.write(y);
</script>


Der Validator beschwert sich über den langen Inhalt der Variable y. Sie soll halt den Quelltext austauschen. Aber der Validator meckert dann an den ganzen kommenden Tags (auch außerhalb des JavaScript Berichs) rum. Er kommt also aus dem Tritt. Die Seite geht trotzdem. Ist es nicht erlaubt eine String-Variable in JavaScript beliebig zu füllen?

Gruß


Zuletzt bearbeitet von xammm am Mi 15.03.2006 01:18, insgesamt 1-mal bearbeitet
  View user's profile Private Nachricht senden Website dieses Benutzers besuchen
dastef

Dabei seit: 03.11.2003
Ort: -
Alter: -
Geschlecht: Männlich
Verfasst Mo 13.03.2006 20:13
Titel

Antworten mit Zitat Zum Seitenanfang

der _genaue_ quelltext und die fehlermeldung des validators?
  View user's profile Private Nachricht senden
Anzeige
Anzeige
xammm
Threadersteller

Dabei seit: 23.01.2006
Ort: Potsdam
Alter: 40
Geschlecht: Männlich
Verfasst Di 14.03.2006 11:42
Titel

Antworten mit Zitat Zum Seitenanfang

Code:
<script type="text/javascript">
var x = Zaehlerstand();
var y = "<table width='236' border='0' cellpadding='0' cellspacing='0' ><tr class='cellback_welcome2'><td valign='top'><table width='236' height='180' border='0' cellpadding='0' cellspacing='0'><td width='18' height='19'></td><td width='180' height='19'>&nbsp;</td><td height='19'>&nbsp;</td></tr><tr><td width='18' height='71'>&nbsp;</td><td width='180' height='71' valign='top'><div align='left'><a href='exit.php' class='xammm'>Notausgang</a> <br> <a href='arialu.php' class='xammm'>Arialu-Artikel</a><br><a href='projekte.php' class='xammm'>PC-Box Video</a></div></td><td height='71'><a href='changelog.php'><img src='1/trans000.gif' alt='' width='40' height='71' border='0'></a></td></tr><tr><td width='18' height='71'>&nbsp;</td><td width='180' height='71' valign='top'><div align='left' class='xammm'>Vernüftige Links<br>Changelog-Seite<br>Elektronik-Seite</div></td><td height='71'><a href='changelog.php'><img src='1/trans000.gif' alt='' width='40' height='71' border='0'></a></td></tr><tr><td width='18' height='53'>&nbsp;</td><td width='180' height='53' valign='top'><div align='left'><a href='http://www.ratemypoo.com/ratemy/poo' target='_blank' class='xammm'>Achtung, ekelhaft!</a><br><span class='Besucheranzahl'>Du bist zum " + x + ". mal auf xammm.com! :)</span> </div></td><td height='53'><a href='changelog.php'><img src='1/trans000.gif' alt='' width='40' height='53' border='0'></a></td></tr></table></td></tr></table>";
if (x == 1) y="<img src='1/willkommen.gif' width='236' height='214' alt=''>";
document.write(y);
</script>


1.) Error Line 305, column 226: end tag for "SCRIPT" omitted, but its declaration does not permit this .

...g='0'><td width='18' height='19'></td><td width='180' height='19'>&nbsp;</td>
You forgot to close a tag, or
you used something inside this tag that was not allowed, and the validator is complaining that the tag should be closed before such content can be allowed.

The next message, "start tag was here" points to the particular instance of the tag in question); the positional indicator points to where the validator expected you to close the tag.


2.) Info Line 303, column 0: start tag was here .

<script type="text/javascript">
3.) Error Line 308, column 8: end tag for element "SCRIPT" which is not open .

</script>

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.


4.) Error Line 309, column 3: end tag for element "P" which is not open .

</p>


5.) Error Line 310, column 4: end tag for element "TD" which is not open .

</td>

----------------------------------------------------------------------------

ab 4.) fangen halt Fehler an, die sich auf den Quelltext nach dem Script beziehen. Da sind noch mehr. Wenn ich das Script entferne (bzw. die beiden Quelltext-Zuweisungen für y), dann gibt es keine Fehler im Dokument. Auch nicht in dem Bereich nach dem Skript. Der Quelltext, der y zugewiesen wird, ist eigentlich an sich in Ordnung.

Gruß
  View user's profile Private Nachricht senden Website dieses Benutzers besuchen
 
Ähnliche Themen Javascript - Validator <head> Probleme?
validator problem
Validator Problem mit &
[erledigt] [Javascript] Formular automstisch abschicken
[Erledigt] Float-Problem bei XHTML
Gästebuch - PHP und MySQL Problem - ERLEDIGT! Danke
Neues Thema eröffnen   Neue Antwort erstellen
MGi Foren-Übersicht -> Programmierung


Du kannst keine Beiträge in dieses Forum schreiben.
Du kannst auf Beiträge in diesem Forum nicht antworten.
Du kannst an Umfragen in diesem Forum nicht mitmachen.