Foros del Web » Creando para Internet » HTML »

XHTML Strict

Estas en el tema de XHTML Strict en el foro de HTML en Foros del Web. El siguente script me da error de que no es xhtml Strict y no se lo que tengo que hacer para que lo sea, espero ...
  #1 (permalink)  
Antiguo 18/02/2006, 18:29
Avatar de teodorojose  
Fecha de Ingreso: enero-2004
Ubicación: Badajoz - España
Mensajes: 108
Antigüedad: 20 años, 9 meses
Puntos: 0
XHTML Strict

El siguente script me da error de que no es xhtml Strict y no se lo que tengo que hacer para que lo sea, espero que me podais ayudar. Saludos
Código:
<script type="text/JavaScript">
var data,ntz,rf;
document.cookie='__support_check=1';
rf=document.referrer;
if(top.document.location==document.referrer || (document.referrer == '' && top.document.location != ''))
{	
rf=top.document.referrer;	
}
ntz=new Date();
data='reff='+escape(rf)+ '&to='+escape(location.pathname)+ '&table=tbl_demouser';
document.write('<img width=1 height=1 src="http://www.canalstats.com/admin/write_logs.php?'+data+'">');
</script>
Si os sirve de algo, estos son los errores que me dan.
Cita:
Warning Line 118 column 76: character "&" is the first character of a delimiter but occurred as data.
...ent.referrer || (document.referrer == '' && top.document.location != ''))
This message may appear in several cases:

You tried to include the "<" character in your page: you should escape it as "&lt;"
You used an unescaped ampersand "&": this may be valid in some contexts, but it is recommended to use "&amp;", which is always safe.
Another possibility is that you forgot to close quotes in a previous tag.



Warning Line 118 column 77: character "&" is the first character of a delimiter but occurred as data.
...t.referrer || (document.referrer == '' && top.document.location != ''))


Warning Line 123 column 31: cannot generate system identifier for general entity "to".
data='reff='+escape(rf)+ '&to='+escape(location.pathname)+ '&table=tbl_demou
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 "&amp;" (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 &aelig; 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.



Error Line 123 column 31: general entity "to" not defined and no default entity.
data='reff='+escape(rf)+ '&to='+escape(location.pathname)+ '&table=tbl_demou
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.



Warning Line 123 column 33: reference not terminated by REFC delimiter.
data='reff='+escape(rf)+ '&to='+escape(location.pathname)+ '&table=tbl_demou
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.



Error Line 123 column 33: reference to entity "to" for which no system identifier could be generated.
data='reff='+escape(rf)+ '&to='+escape(location.pathname)+ '&table=tbl_demou
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.



Info Line 123 column 30: entity was defined here.
data='reff='+escape(rf)+ '&to='+escape(location.pathname)+ '&table=tbl_demou
Warning Line 123 column 65: cannot generate system identifier for general entity "table".
...f='+escape(rf)+ '&to='+escape(location.pathname)+ '&table=tbl_demouser';


Error Line 123 column 65: general entity "table" not defined and no default entity.
...f='+escape(rf)+ '&to='+escape(location.pathname)+ '&table=tbl_demouser';


Warning Line 123 column 70: reference not terminated by REFC delimiter.
...(rf)+ '&to='+escape(location.pathname)+ '&table=tbl_demouser';


Error Line 123 column 70: reference to entity "table" for which no system identifier could be generated.
...(rf)+ '&to='+escape(location.pathname)+ '&table=tbl_demouser';


Info Line 123 column 64: entity was defined here.
...eff='+escape(rf)+ '&to='+escape(location.pathname)+ '&table=tbl_demouser';
Error Line 124 column 31: an attribute value specification must be an attribute value literal unless SHORTTAG YES is specified.
document.write('<img width=1 height=1 src="http://www.canalstats.com/admin/w


Error Line 124 column 40: an attribute value specification must be an attribute value literal unless SHORTTAG YES is specified.
document.write('<img width=1 height=1 src="http://www.canalstats.com/admin/w


Error Line 124 column 103: required attribute "alt" not specified.
...ts.com/admin/write_logs.php?'+data+'">');
The attribute given above is required for an element that you've used, but you have omitted it. For instance, in most HTML and XHTML document types the "type" attribute is required on the "script" element and the "alt" attribute is required for the "img" element.

Typical values for type are type="text/css" for <style> and type="text/javascript" for <script>.



Error Line 124 column 103: document type does not allow element "img" here.
...ts.com/admin/write_logs.php?'+data+'">');
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).



Error Line 124 column 104: end tag for "img" omitted, but OMITTAG NO was specified.
...s.com/admin/write_logs.php?'+data+'">');
You may have neglected to close an element, or perhaps you meant to "self-close" an element, that is, ending it with "/>" instead of ">".
__________________
Saludos a todos :adios:
  #2 (permalink)  
Antiguo 18/02/2006, 23:53
 
Fecha de Ingreso: enero-2006
Mensajes: 30
Antigüedad: 18 años, 10 meses
Puntos: 1
Prueba a meter el script dentro de una sección CDATA:

Código:
<script type="text/JavaScript">
<![CDATA[
var data,ntz,rf;
.
.
]]>
</script>
Saludos.
Atención: Estás leyendo un tema que no tiene actividad desde hace más de 6 MESES, te recomendamos abrir un Nuevo tema en lugar de responder al actual.
Respuesta




La zona horaria es GMT -6. Ahora son las 22:26.