crispybuck
12-09-2004, 11:48 AM
Hello world. I took, from this site, a javascript to allow the date and time to be displayed on my site.
when i run an accessiblity check on the page the script appears in the check tells me it has failed due to the script not have an associated valid NOSCRIPT.
Not having any experience with Java before, i'm at a loss as how to fix this... it's prob. very simple ... help please.
the script is below:
<script language=JavaScript class="text">
<!-- This script and many more are available free online at -->
<!-- The JavaScript Source!! http://javascript.internet.com -->
<!-- Begin
var day="";
var month="";
var myweekday="";
var year="";
newdate = new Date();
mydate = new Date();
dston = new Date('April 4, 2001 2:59:59');
dstoff = new Date('october 31, 2001 2:59:59');
var myzone = newdate.getTimezoneOffset();
newtime=newdate.getTime();
var zone = 0; // references your time zone
if (newdate > dston && newdate < dstoff ) {
zonea = zone - 1 ;
dst = " British Summer Time";
}
else {
zonea = zone ; dst = " Pacific Standard Time";
}
var newzone = (zonea*60*60*1000);
newtimea = newtime+(myzone*60*1000)-newzone;
mydate.setTime(newtimea);
myday = mydate.getDay();
mymonth = mydate.getMonth();
myweekday= mydate.getDate();
myyear= mydate.getYear();
year = myyear;
if (year < 2000) // Y2K Fix, Isaac Powell
year = year + 1900; // http://onyx.idbsu.edu/~ipowell
myhours = mydate.getHours();
if (myhours >= 12) {
if (myhours >= 18) {
myhours = (myhours == 18) ? 0 : myhours; mm = "";
}
else {
myhours = (myhours == 12) ? 12 : myhours; mm = "";
}}
else {
myhours = (myhours == 0) ? 12 : myhours; mm = "";
}
myminutes = mydate.getMinutes();
if (myminutes < 10){
mytime = ":0" + myminutes;
}
else {
mytime = ":" + myminutes;
};
arday = new Array("Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday")
armonth = new Array("January ","February ","March ","April ","May ","June ","July ","August ","September ", "October ","November ","December ")
ardate = new Array("0th","1","2","3","4","5","6","7","8","9","10","11","12","13","14","15","16","17","18","19","20","21","22","23","24","25","26","27","28","29","30","31");
// rename locale as needed.
var time = (arday[myday] + " " + ardate[myweekday] + " " + armonth[mymonth] + " " + year+"<br>" + mm +"");
document.write(time);
//--></script>
</p>
</div></td>
when i run an accessiblity check on the page the script appears in the check tells me it has failed due to the script not have an associated valid NOSCRIPT.
Not having any experience with Java before, i'm at a loss as how to fix this... it's prob. very simple ... help please.
the script is below:
<script language=JavaScript class="text">
<!-- This script and many more are available free online at -->
<!-- The JavaScript Source!! http://javascript.internet.com -->
<!-- Begin
var day="";
var month="";
var myweekday="";
var year="";
newdate = new Date();
mydate = new Date();
dston = new Date('April 4, 2001 2:59:59');
dstoff = new Date('october 31, 2001 2:59:59');
var myzone = newdate.getTimezoneOffset();
newtime=newdate.getTime();
var zone = 0; // references your time zone
if (newdate > dston && newdate < dstoff ) {
zonea = zone - 1 ;
dst = " British Summer Time";
}
else {
zonea = zone ; dst = " Pacific Standard Time";
}
var newzone = (zonea*60*60*1000);
newtimea = newtime+(myzone*60*1000)-newzone;
mydate.setTime(newtimea);
myday = mydate.getDay();
mymonth = mydate.getMonth();
myweekday= mydate.getDate();
myyear= mydate.getYear();
year = myyear;
if (year < 2000) // Y2K Fix, Isaac Powell
year = year + 1900; // http://onyx.idbsu.edu/~ipowell
myhours = mydate.getHours();
if (myhours >= 12) {
if (myhours >= 18) {
myhours = (myhours == 18) ? 0 : myhours; mm = "";
}
else {
myhours = (myhours == 12) ? 12 : myhours; mm = "";
}}
else {
myhours = (myhours == 0) ? 12 : myhours; mm = "";
}
myminutes = mydate.getMinutes();
if (myminutes < 10){
mytime = ":0" + myminutes;
}
else {
mytime = ":" + myminutes;
};
arday = new Array("Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday")
armonth = new Array("January ","February ","March ","April ","May ","June ","July ","August ","September ", "October ","November ","December ")
ardate = new Array("0th","1","2","3","4","5","6","7","8","9","10","11","12","13","14","15","16","17","18","19","20","21","22","23","24","25","26","27","28","29","30","31");
// rename locale as needed.
var time = (arday[myday] + " " + ardate[myweekday] + " " + armonth[mymonth] + " " + year+"<br>" + mm +"");
document.write(time);
//--></script>
</p>
</div></td>