Forum Moderators: open
<script language="JavaScript" type="text/JavaScript">
<!-- Begin
NewImg = new Array (
"images/BD_DGRB.jpg",
"images/BD_GRB.jpg",
"images/BD_LBRB.jpg",
"images/BD_PRB.jpg",
"images/BD_pwwRB.jpg",
"images/BD_showRB.jpg",
"images/BD_ZRB.jpg",
"images/TBcreambox.jpg",
"images/TBdarkbluebox.jpg",
"images/TBredrigid.jpg",
"images/BD_HRB.jpg"
);
var ImgNum = 0;
var ImgLength = NewImg.length - 1;
//Time delay between Slides in milliseconds
var delay = 3000;
var lock = false;
var run;
function chgImg(direction) {
if (document.images) {
ImgNum = ImgNum + direction;
if (ImgNum > ImgLength) {
ImgNum = 0;
}
if (ImgNum < 0) {
ImgNum = ImgLength;
}
document.slideshow.src = NewImg[ImgNum];
}
}
function auto() {
if (lock == true) {
lock = false;
window.clearInterval(run);
}
else if (lock == false) {
lock = true;
run = setInterval("chgImg(1)", delay);
}
}
// End -->
</script>
and it works great but it is also putting this into the head section of the page when it is live.
<script language="JavaScript">
<!--
function SymError()
{
return true;
}
window.onerror = SymError;
var SymRealWinOpen = window.open;
function SymWinOpen(url, name, attributes)
{
return (new Object());
}
window.open = SymWinOpen;
//-->
</script>
The problem is, is that it is making the page not valid <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> with W3C standards.Any ideas on how can I fix this?
Thanks
A couple of pointers:
- The language attribute (of script tag) is deprecated.
- probably need proper CDATA tags to wrap the script's text in.
So:
- Get rid of the language attribute.
- Put the script into an external script file.
sorted..
..maybe.
1. Line 8, column 29: required attribute "type" not specified
<script language="JavaScript">
2. Line 30, column 36: "script" is not a member of a group specified for any attribute
<script language="JavaScript"script src="../scoll.js"></script>
3. Line 30, column 53: required attribute "type" not specified
<script language="JavaScript"script src="../scoll.js"></script>
4.Line 165, column 29: required attribute "type" not specified
<script language="JavaScript">
5.Line 165, column 29: document type does not allow element "script" here
<script language="JavaScript">
any idea what I am doing wrong?
Thanks