html tutorials web design help css tutorials free web graphics diy search engine optimization

Add a Refresh Button to Your Page

You can create your own refresh button or text link for your web pages. This could be useful for web cam pages, dynamic scripts like the Dumb Random Story Generator I used to have, for slide shows, or anything you can think of that requires the user to refresh the page. If you update your site often, it could be offered so the user can ensure he or she is viewing the latest content.

Click the refresh button below to try it.

How to Get Fresh

The code is a simple javascript. Just copy and paste the code below. You can use my demonstration image as long as you don't link directly to it, then you won't have to change the code at all unless you keep your images in a different directory than shown. Here's the code:
<a href="javascript:document.location.reload();"
ONMOUSEOVER="window.status='Refresh'; return true"
ONMOUSEOUT="window.status='ah... that was good'">
<img src="images/refresh.jpg" 
width="115" height="31" border="0" /></a>

The code also shows the word "Refresh" in the status bar when a mouse is over the refresh link. When you remove your mouse from the refresh link, the status bar message changes to "ah... that was good." You can change those messages. Just don't mess up the quote or double quote marks or it messes up the script.

If you'd prefer to use a text link to refresh the page just replace the image with the text you want.

Now go have some ice cream. Life is too short not to have ice cream now and then. Even better, buy me some ice cream, life is too short not to share. I like ice cream!

Back | Web Design Tutorials Index

Ezine for Webmasters

Bookmark and Share

Almost a Newsletter

Changing list hosts. Will post a new subscribe form shortly.

Did you know...

The member's site has about 100 standards compliant HTML and CSS tutorials, 31 handy reference charts, reprintable content, web graphics, exclusive fonts, free software, free ebooks and more? All this for less than 9 cents a day! [ Details ]
See my fancy bottom! :)