Woody’s JavaScripts
Here is my small collection of useful JavaScripts. Please feel free to use, copy and/or modify any of these scripts for your needs. I have posted these scripts for people to use. I have tried to include more comments than most scripters so that people can learn how these scripts work.
Automatically write the modified date of your web page within your web page.
Avoid spam or unwanted emails by hiding your address. This method replaces your email address link or HTML anchor tag with a JavaScript function call. Legitimate visitors can see your address, even click on it to launch their email client; but your email address will remain hidden to those spam search robots.
An alternative method to hide your email address is to encode your plain text into HTML character entities. This worksheet encodes your email address into an email link that you can paste directly into your HTML document. No JavaScript is necessary.
This is an older method to avoid spam or unwanted emails. This method uses an anchor tag that is a little more complicated than the writeEmailLink method above.
This is a weekday countdown counter. It calculates the number of weekdays until a target date. (Weekends are not included in the count.) This function is perfect for counting down the number of weekdays to the end of school or project deadline. A list of holidays or non-working weekdays can be created to subtract from the count. Note, this function does not loop through and count the number of weekdays--it actually calculates the number.
This is a weekday counter. It calculates the number of weekdays from a start date. (Weekends are not included in the count.) The start date is included in the count. This function is perfect for counting the number of weekdays spent on a project. A list of holidays or non-working weekdays can be created to subtract from the count. Note, this function does not loop through and count the number of weekdays--it actually calculates the number.
Display a random image when a page is loaded into a browser.
Switch or rollover an image when the mouse cursor moves over it. This function is perfect for highlighting menu choices.