![]() |
|
|
Advanced Web Design | ||
| Web Design Program | |||||
|
|
Scripting Database |
|
|||
|
Expiration of items on a page |
|||||||||||||||||||||||||||||||||||
|
When you add something to your site or modify something, you usually
place a Using JavaScript, it is possible to program your HTML to display the
new icon only for a certain period of time. You write a JavaScript function
which compares the current date with the expiryDate and inserts the new
icon only if the current date has not exceeded the expiryDate. Here is
the code : Usually, functions like this are defined between the <HEAD> and </HEAD>
part of the HTML. Change the new.gif to the name of your image and modify
the WIDTH and HEIGHT attributes accordingly. Now where ever you want to
put the icon, insert the following code : The icon will be shown up to the date you specify as the parameter for newItem().
|
||||||||||||||||||||||||||||||||||||