Jump to content

ayuda con validacion html


Recommended Posts

hola amigos

quisiera hacer una consulta sobre como lograr la validación html con este codigo si hay alguna otra forma

de utilizarlo

<script type="text/javascript">
if (screen.width < 1024 ) {document.write('<link rel="stylesheet" type="text/css" href="../css/nosotros800.css">');}
else if (screen.width == 1024) {document.write('<link rel="stylesheet" type="text/css" href="../css/nosotros1024.css">');}
else {document.write('<link rel="stylesheet" type="text/css" href="../css/nosotros1024.css">');}
</script>

me salen 6 errores

 

Line 7, Column 19: character "<" is the first character of a delimiter but occurred as data
if (screen.width < 1024 ) {document.write('<link rel="stylesheet" type="text/c…
✉
This message may appear in several cases:
You tried to include the "<" character in your page: you should escape it as "<"
You used an unescaped ampersand "&": this may be valid in some contexts, but it is recommended to use "&", which is always safe.
Another possibility is that you forgot to close quotes in a previous tag.
Line 7, Column 113: document type does not allow element "link" here
…rite('<link rel="stylesheet" type="text/css" href="../css/nosotros800.css">');}
✉
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).
Line 7, Column 114: end tag for "link" omitted, but OMITTAG NO was specified
…rite('<link rel="stylesheet" type="text/css" href="../css/nosotros800.css">');}
✉
You may have neglected to close an element, or perhaps you meant to "self-close" an element, that is, ending it with "/>" instead of ">".
Line 7, Column 45: start tag was here
…creen.width < 1024 ) {document.write('<link rel="stylesheet" type="text/css" h…
Line 9, Column 119: document type does not allow element "link" here
…ite('<link rel="stylesheet" type="text/css" href="../css/nosotros1024.css">');}
✉
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).
Line 9, Column 120: end tag for "link" omitted, but OMITTAG NO was specified
…ite('<link rel="stylesheet" type="text/css" href="../css/nosotros1024.css">');}
✉
You may have neglected to close an element, or perhaps you meant to "self-close" an element, that is, ending it with "/>" instead of ">".
Line 9, Column 50: start tag was here
…creen.width == 1024) {document.write('<link rel="stylesheet" type="text/css" h…
Line 11, Column 93: document type does not allow element "link" here
…ite('<link rel="stylesheet" type="text/css" href="../css/nosotros1024.css">');}
✉
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).
Line 11, Column 94: end tag for "link" omitted, but OMITTAG NO was specified
…ite('<link rel="stylesheet" type="text/css" href="../css/nosotros1024.css">');}
✉
You may have neglected to close an element, or perhaps you meant to "self-close" an element, that is, ending it with "/>" instead of ">".
Line 11, Column 24: start tag was here
else {document.write('<link rel="stylesheet" type="text/css" href="../css/noso…

 

espero su ayuda!!

gracias...

 

EDIT:

 

solución pasar validacion html w3c de javascript

comentar script

<script type="text/javascript"> 
<!-- 
   function miFuncionJavascript() 
   { 
   ........ 
   } 
--> 
</script> 

Edited by jonydread
Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...