how to add current time and random images in FrontPage?

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I need to add the current time and date as well as random images whenever the
page is refreshed. I don't know if Frontpage 2003 has those capabilities.
If you know how to do it please share the info. THanks
 
The following script displays the current date and time on the Web visitor's
computer.

<script>document.write(new Date());</script>

and this one displays one of thee random pictures.

<script>
pics = new Array("sample10.jpg",
"sample11.jpg",
"sample12.jpg");
curDate = new Date();
curTim = curDate.getTime();
picNum = curTim % pics.length;
document.write("<img src='images/" + pics[picNum] +
"' border='0'>");
</script>

If you want more than three pictures, just enlarge the array.

If the path from your web page to the folder that contains the pictures is
other than images/, you'll need to adjust that, too.

Jim Buyens
Microsoft FrontPage MVP
http://www.interlacken.com
Author of:
*----------------------------------------------------
|\---------------------------------------------------
|| Microsoft Office FrontPage 2003 Inside Out
||---------------------------------------------------
|| Web Database Development Step by Step .NET Edition
|| Microsoft FrontPage Version 2002 Inside Out
|| Faster Smarter Beginning Programming
|| (All from Microsoft Press)
|/---------------------------------------------------
*----------------------------------------------------
 

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

Back
Top