could someone explain how this code would work? i need to understand it, and is it possible to make the link disapear on a certin date, and can you refine the appear and disapear to a specific time as well?
script><script type="text/javascript">
var display_date=new Date('04/04/2008');//this will be the date the link starts displaying
var currentTime = new Date();
var month = currentTime.getMonth() + 1;
var day = currentTime.getDate();
var year = currentTime.getFullYear();
//get all dates in the same format
var current_date = new Date(month +'/' + day + '/' + year);
if(current_date>=display_date){
document.write('<a href="newlink.html">new link</a>');
}
</script>
Edited by thero_cpd, 27 June 2009 - 02:44 PM.