Although I try to keep it to a minimum, javascript can be a useful tool in developing an online applications or websites. I have developed a wide range to javascript tools for websites from dynamic form elements to full page manipulation.
Its important to remember when using javascript that some people dont have it enabled or have no-script extentions on thir browsers, this stops the code from running so javascript should not be used for any important aspects of the site, e.g. navigation, unless there is a non-javascript alternative available.
function GetDay(intDay){ var DayArray = new Array("Sunday", "Monday", "Tuesday", "Wednesday", "Thursday", "Friday", "Saturday") return DayArray[intDay] } function GetMonth(intMonth){ var MonthArray = new Array("January", "February", "March", "April", "May", "June", "July", "August", "September", "October", "November", "December") return MonthArray[intMonth] } function getDateStrWithDOW(){ var today = new Date() var year = today.getYear() if(year<1000) year+=1900 var todayStr = GetDay(today.getDay()) + ", " todayStr += GetMonth(today.getMonth()) + " " + today.getDate() todayStr += ", " + year return todayStr }
Please note: All code samples shown on this site are licensed under a
Creative Commons Attribution-NonCommercial-ShareAlike 3.0 Unported License