F
fedorpawel
I want to redirect the user to the current month such as
November2006.html, but only if the month exists in pubMon array. This
code works correctely in IE but stopped working in the new Firefox. In
Firefox it always redirects to the default Annoucments.html. What am I
missing?
Thanks for any help.
/////Returns true if the val is an element of the array a
function find(a, val){
var b = false;
for(i=0;i<a.length;i++){
if(a==val) { b = true;}
}
return b;
};
/////This function does the redirecting.
function CurrMonth() {
today = new Date();
m = new
Array("January","February","March","April","May","June","July","August","September","October","November","December");
pubMon = new Array("8", "9", "10", "11", "12");
pubYear = new Array("2006");
ValidMonth = find(pubMon, today.getMonth() + 1);
ValidYear = find(pubYear, today.getYear());
if (ValidMonth && ValidYear) { window.location = m[today.getMonth()] +
today.getYear() + ".html"; }
else { window.location = 'Announcements.html'; }
}
November2006.html, but only if the month exists in pubMon array. This
code works correctely in IE but stopped working in the new Firefox. In
Firefox it always redirects to the default Annoucments.html. What am I
missing?
Thanks for any help.
/////Returns true if the val is an element of the array a
function find(a, val){
var b = false;
for(i=0;i<a.length;i++){
if(a==val) { b = true;}
}
return b;
};
/////This function does the redirecting.
function CurrMonth() {
today = new Date();
m = new
Array("January","February","March","April","May","June","July","August","September","October","November","December");
pubMon = new Array("8", "9", "10", "11", "12");
pubYear = new Array("2006");
ValidMonth = find(pubMon, today.getMonth() + 1);
ValidYear = find(pubYear, today.getYear());
if (ValidMonth && ValidYear) { window.location = m[today.getMonth()] +
today.getYear() + ".html"; }
else { window.location = 'Announcements.html'; }
}