W3C Parsing Fehler?

KingKoQ

New member
Hallo!
Ich hab meine Seite gerade durch den Validator von W3C.org gejagt.

Mein Doctype:
HTML:
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/1999/REC-html401-19991224/loose.dtd">

Es gibt nur fehler im folgenden Bereich (Fehler bezüglich HTML angaben).
Das sollte doch normalterweise gar nicht HTML-geparst werden.(1. Script element, 2. <!-- ... -->)
Oder ist das ein Fehler meinerseits?
HTML:
<script type="text/javascript"><!--


document.cookie = "js_status=on";

function Show(id)
{
 document.getElementById(id).style.position = 'relative';
 document.getElementById(id).style.visibility = 'visible';
}

function Hide(id)
{
 document.getElementById(id).style.position = 'absolute';
 document.getElementById(id).style.visibility = 'hidden';
}


function BBCodeInsert(field, startTag, endTag, offset)
{
field.focus();
if (document.getSelection)
{ //FF, NS
  selStart = field.selectionStart;
  selEnd = field.selectionEnd;
  text = field.value.substring(selStart, selEnd);
  field.value = field.value.substring(0, selStart) + startTag + text + endTag + field.value.substring(selEnd);
  if (text.length > 0)
  {
    if (offset != 0)
    {
      field.selectionStart = selStart + startTag.length + text.length - offset;
    }
    else
    {
      field.selectionStart = selStart + startTag.length + text.length + endTag.length;
    }
  }
  else
  {
     field.selectionStart = selStart + startTag.length;
  }
  field.selectionEnd = field.selectionStart;
} else
if (document.selection) { //IE
    marker = document.selection.createRange();
    text = marker.text;
    marker.text = startTag+text+endTag;
    marker = document.selection.createRange();
    if (text.length > 0)
    {
      if (offset != 0)
      {
        marker.move('character', startTag.length + text.length - offset);
      }
      else
      {
        marker.move('character', startTag.length + text.length + endTag.length + offset);
      }
    }
    else
    {
      marker.move('character', -(endTag.length));
    }
    marker.select();
 }
}


   var http_request = false;

function YouTubeShowDetails(id, youtube_id)
{

 document.getElementById('YouTubeVideoBox' + id).style.visibility = 'visible';

 document.getElementById('YouTubeVideoBox'+ id +'Video').innerHTML = 'Bitte warten...';
 setTimeout('document.getElementById(\'YouTubeVideoBox'+ id +'Video\').innerHTML = \'<object width="425" height="350"><param name="movie" value="http://www.youtube.com/v/'+ youtube_id +'" /><param name="wmode" value="transparent" /><embed src="http://www.youtube.com/v/'+ youtube_id +'" type="application/x-shockwave-flash" wmode="transparent" width="425" height="350" /></object><br /><a style="font-family: verdana; font-size:10px;" target="_blank" href="http://www.youtube.com/watch?v='+ youtube_id +'">Bei YouTube ansehen.</a>\';', 1000);
}

function YouTubeVideoShow(id, youtube_id)
{
 //<input type="button" onClick="YouTubeVideoShow('0', youtube_id);" value="Video anzeigen" id="YoutubeVideoButton0" /><span class="klein" id="YoutubeVideo"></span>

 document.getElementById('YoutubeVideoButton' + id).style.visibility = 'hidden';
 document.getElementById('YoutubeVideoButton' + id).style.position = 'absolute';
 document.getElementById('YoutubeVideo' + id).innerHTML = 'Bitte warten...' ;
 setTimeout('document.getElementById(\'YoutubeVideo'+ id +'\').innerHTML = \'<object width="425" height="350"><param name="movie" value="http://www.youtube.com/v/'+ youtube_id +'" /><param name="wmode" value="transparent" /><embed src="http://www.youtube.com/v/'+ youtube_id +'" type="application/x-shockwave-flash" wmode="transparent" width="425" height="350" /></object><br />(<a href="javascript:YouTubeVideoHide('+ id +');" style="font-family: verdana; font-size:10px; text-decoration: none; border-bottom: thin dotted #156899;">Video verstecken</a>) | <a style="font-family: verdana; font-size:10px;" target="_blank" href="http://www.youtube.com/watch?v='+ youtube_id +'">Bei YouTube ansehen.</a>\';', 500);

}

function YouTubeVideoHide(id, youtube_id)
{
 //<input type="button" onClick="YouTubeVideoShow('0', youtube_id);" value="Video anzeigen" id="YoutubeVideoButton0" /><span class="klein" id="YoutubeVideo"></span>

 document.getElementById('YoutubeVideoButton' + id).style.visibility = 'visible';
 document.getElementById('YoutubeVideoButton' + id).style.position = 'relative';
 document.getElementById('YoutubeVideo' + id).innerHTML = '' ;
}

function YouTubeHideDetails(id)
{

 document.getElementById('YouTubeVideoBox'+ id).style.visibility = 'hidden';

 document.getElementById('YouTubeVideoBox'+ id +'Video').innerHTML = '';
}

    function make_response(modus, url, parameter, req_header_true_false)
    {

        http_request = false;

        if (window.XMLHttpRequest) { // Mozilla, Safari,...
            http_request = new XMLHttpRequest();
            if (http_request.overrideMimeType) {
                http_request.overrideMimeType('text/html');
                // zu dieser Zeile siehe weiter unten
            }
        } else if (window.ActiveXObject) { // IE
            try {
                http_request = new ActiveXObject("Msxml2.XMLHTTP");
            } catch (e) {
                try {
                    http_request = new ActiveXObject("Microsoft.XMLHTTP");
                } catch (e) {}
            }
        }

        if (!http_request) {
            alert('Ende :( Kann keine XMLHTTP-Instanz erzeugen');
            return false;
        }
        //http_request.onreadystatechange = alertInhalt;
        http_request.open(modus, url, false);
        if(req_header_true_false == true)
        {
         http_request.setRequestHeader("Content-Type","application/x-www-form-urlencoded; charset=ISO-8859-1");
        }
        http_request.send(parameter);

        if (http_request.readyState == 4 && http_request.status == 200)
        {
           var answer = http_request.responseText;
              //var answer = http_request.responseText;

               //document.getElementById('ajaxbox').innerHTML += answer;
               //alert(answer);



        }
        else
        {
         var answer = 'ERROR';
        }


     return(answer);
    }




   // <<<<<<<<<< HOW TO USE >>>>>>>>>>
  // var wdn = make_response('GET','ajax.php?mode=test_aj', 'mode=test_aj', false);


//-->
</script>
 
Bein allen innerhalb des Scripts vorkommenden schließenden Tags den slash mit einem backslash maskieren...
 
Zurück
Oben