Article View: pl.comp.lang.javascript
Article #51026Walidacja skryput w3c
From: narskitom
Date: Fri, 17 Feb 2012 13:49
Date: Fri, 17 Feb 2012 13:49
94 lines
4398 bytes
4398 bytes
Mam w sekcji <head> wstawiony taki oto skrypt:
<script type="text/javascript">
function getAjaX(func,str)
{
if (str=="")
{
document.getElementById("txtHint").innerHTML="";
return;
}
if (window.XMLHttpRequest)
{// code for IE7+, Firefox, Chrome, Opera, Safari
xmlhttp=new XMLHttpRequest();
}
else
{// code for IE6, IE5
xmlhttp=new ActiveXObject("Microsoft.XMLHTTP");
}
xmlhttp.onreadystatechange=function()
{
if (xmlhttp.readyState==4 && xmlhttp.status==200)
{
document.getElementById("txtHint").innerHTML=xmlhttp.responseText;
}
}
xmlhttp.open("GET","ajax.php?f="+func+"&q="+str,true);
xmlhttp.send();
}
</script>
o problem z walidatorem w3c, który wyświetla błędy:
Line 59, Column 42: cannot generate system identifier for general
entity "q"
xmlhttp.open("GET","ajax.php?f="+func+"&q="+str,true);
✉
An entity reference was found in the document, but there is no
reference by that name defined. Often this is caused by misspelling
the reference name, unencoded ampersands, or by leaving off the
trailing semicolon (;). The most common cause of this error is
unencoded ampersands in URLs as described by the WDG in "Ampersands in
URLs".
Entity references start with an ampersand (&) and end with a
semicolon (;). If you want to use a literal ampersand in your document
you must encode it as "&" (even inside URLs!). Be careful to end
entity references with a semicolon or your entity reference may get
interpreted in connection with the following text. Also keep in mind
that named entity references are case-sensitive; &Aelig; and æ
are different characters.
If this error appears in some markup generated by PHP's session
handling code, this article has explanations and solutions to your
problem.
Note that in most documents, errors related to entity references will
trigger up to 5 separate messages from the Validator. Usually these
will all disappear when the original problem is fixed.
Line 59, Column 42: general entity "q" not defined and no default
entity
xmlhttp.open("GET","ajax.php?f="+func+"&q="+str,true);
✉
This is usually a cascading error caused by a an undefined entity
reference or use of an unencoded ampersand (&) in an URL or body text.
See the previous message for further details.
Line 59, Column 43: reference not terminated by REFC delimiter
xmlhttp.open("GET","ajax.php?f="+func+"&q="+str,true);
✉
If you meant to include an entity that starts with "&", then you
should terminate it with ";". Another reason for this error message is
that you inadvertently created an entity by failing to escape an "&"
character just before this text.
Line 59, Column 43: reference to entity "q" for which no system
identifier could be generated
xmlhttp.open("GET","ajax.php?f="+func+"&q="+str,true);
✉
This is usually a cascading error caused by a an undefined entity
reference or use of an unencoded ampersand (&) in an URL or body text.
See the previous message for further details.
Line 59, Column 41: entity was defined here
xmlhttp.open("GET","ajax.php?f="+func+"&q="+str,true);
czy mógłym prosić o pomoc co może być nie tak bo wydaje się wszystko
ok ale błędy są. Z góry dziękuję za pomoc
Technical Details
Message-ID:
<664e756b-dc0d-4a1d-a80c-555c1e9039d7@do4g2000vbb.googlegroups.com>Path:
mbox-mo1.pugleaf.net!news-archive.icm.edu.pl!news.gazeta.pl!newsfeed.pionier.net.pl!news.glorb.com!postnews.google.com!do4g2000vbb.googlegroups.com!not-for-mailShow Full Headers
Complete Article Headers
Path: mbox-mo1.pugleaf.net!news-archive.icm.edu.pl!news.gazeta.pl!newsfeed.pionier.net.pl!news.glorb.com!postnews.google.com!do4g2000vbb.googlegroups.com!not-for-mail From: narskitom@yahoo.pl Newsgroups: pl.comp.lang.javascript Subject: Walidacja skryput w3c Date: Fri, 17 Feb 2012 05:49:23 -0800 (PST) Organization: http://groups.google.com Lines: 95 Message-ID: <664e756b-dc0d-4a1d-a80c-555c1e9039d7@do4g2000vbb.googlegroups.com> NNTP-Posting-Host: 195.158.247.1 Mime-Version: 1.0 X-Trace: posting.google.com 1329486672 30123 127.0.0.1 (17 Feb 2012 13:51:12 GMT) X-Complaints-To: groups-abuse@google.com NNTP-Posting-Date: Fri, 17 Feb 2012 13:51:12 +0000 (UTC) Complaints-To: groups-abuse@google.com Injection-Info: do4g2000vbb.googlegroups.com; posting-host=195.158.247.1; posting-account=-JQuHAoAAAA1YXw76YzgM40YUOOFOj3j User-Agent: G2/1.0 X-Google-Web-Client: true X-Google-Header-Order: UHALERCNK X-HTTP-UserAgent: Opera/9.80 (Windows NT 5.1; U; pl) Presto/2.10.229 Version/11.61,gzip(gfe) Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit