scripting

A

Ashley Horsley

Hi,
I am trying to make a script that will detect the current
year and then redirect the person to a specific page for
that year. Can you help?
Thanks
 
M

MD Websunlimited

Hi Ashely,

Sure we can help.

<script>
oDate = new Date(); // get date object
iYear = oDate.getFullYear();
window.location.href = 'year_' + iYear + '.htm';
</script>
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top