PowerMacX
2005.06.27, 02:54 PM
I'm getting the following validation error using the xhtml validator at http://validator.w3.org/
#
Line 21, column 27: character ";" not allowed in attribute specification list
for (i=0;i<divList.length;i++)
✉
#
Line 21, column 27: element "divList.length" undefined
for (i=0;i<divList.length;i++)
You have used the element named above in your document, but the document type you are using does not define an element of that name. This error is often caused by incorrect use of the "Strict" document type with a document that uses frames (e.g. you must use the "Frameset" document type to get the "<frameset>" element), or by using vendor proprietary extensions such as "<spacer>" or "<marquee>" (this is usually fixed by using CSS to achieve the desired effect instead).
✉
#
Line 27, column 8: end tag for "divList.length" omitted, but OMITTAG NO was specified
</script>
You may have neglected to close a tag, or perhaps you meant to "self-close" a tag; that is, ending it with "/>" instead of ">".
✉
#
Line 21, column 12: start tag was here
for (i=0;i<divList.length;i++)
Basically, I have a simple javascript that looks like this:
<script>
function something() {
var divList = document.getElementsByTagName("div");
...
for (i=0;i<divList.length;i++)
...
}
</script>
The validator is complaining about the "<" used in the for loop, but swapping it for a < doesn't work, and it shouldn't even be necesary to begin with.
Anyone knows of a workaround? It is the only non-validating bit on that particular page :mad: :cry:
Edit: I'm using XHTML Transitional
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
#
Line 21, column 27: character ";" not allowed in attribute specification list
for (i=0;i<divList.length;i++)
✉
#
Line 21, column 27: element "divList.length" undefined
for (i=0;i<divList.length;i++)
You have used the element named above in your document, but the document type you are using does not define an element of that name. This error is often caused by incorrect use of the "Strict" document type with a document that uses frames (e.g. you must use the "Frameset" document type to get the "<frameset>" element), or by using vendor proprietary extensions such as "<spacer>" or "<marquee>" (this is usually fixed by using CSS to achieve the desired effect instead).
✉
#
Line 27, column 8: end tag for "divList.length" omitted, but OMITTAG NO was specified
</script>
You may have neglected to close a tag, or perhaps you meant to "self-close" a tag; that is, ending it with "/>" instead of ">".
✉
#
Line 21, column 12: start tag was here
for (i=0;i<divList.length;i++)
Basically, I have a simple javascript that looks like this:
<script>
function something() {
var divList = document.getElementsByTagName("div");
...
for (i=0;i<divList.length;i++)
...
}
</script>
The validator is complaining about the "<" used in the for loop, but swapping it for a < doesn't work, and it shouldn't even be necesary to begin with.
Anyone knows of a workaround? It is the only non-validating bit on that particular page :mad: :cry:
Edit: I'm using XHTML Transitional
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">