Improve Site Performance Increase Site Traffic Monitor Site Uptime Webmaster Resources NetMechanic Home Looking For Help? Partner Programs Privacy Policy Contact Us Press Room
NetMechanic Home LOGIN | HELP | ABOUT US | PRODUCTS | SITE MAP
NetMechanic Menu
Over 52 Million Web Pages Tested!     
 
usable web page tips.
search engine optimization story search.
Search for:


Your Email:

I would like to receive my newsletter in:
HTML format
Text format


usability testing.
Volume 8 (2005)
   September
   June
   April
   March
   January

Volume 7 (2004)
   November
   September
   July
   June
   May
   April
   March
   February (Part 2)
   February
   January (Part 2)
   January

Volume 6 (2003)
   December
   November (Part 2)
   November
   September
   August (Part 2)
   August
   July (Part 2)
   July
   June (Part 2)
   June
   May (Part 2)
   May
   April (Part 2)
   April
   March (Part 2)
   March
   February (Part 2)
   February
   January (Part 2)
   January

Volume 5 (2002)
   December (Part 2)
   December
   November (Part 2)
   November
   October (Part 2)
   October
   September (Part 2)
   September
   August (Part 2)
   August
   July (Part 2)
   July
   June (Part2)
   June
   May (Part 2)
   May
   April (Part 2)
   April
   March (Part 2)
   March
   February (Part 2)
   February
   January (Part 2)
   January

Volume 4 (2001)
   December (Part 2)
   December
   November (Part 2)
   November
   October (Part 2)
   October
   September (Part 2)
   September
   August (Part 2)
   August
   July (Part 2)
   July
   June (Part 2)
   June
   May (Part 2)
   May
   April (Part 2)
   April
   March (Part 2)
   March
   February (Part 2)
   February
   January (Part 2)
   January

Volume 3 (2000)
   December (Part 2)
   December
   November (Part 2)
   November
   October (Part 2)
   October
   September (Part 2)
   September
   August (Part 2)
   August
   July (Part 2)
   July
   June
   May
   April
   March
   February
   January

Volume 2 (1999)
   December
   November
   October
   September
   July
   June
   May
   April
   March
   February
   January

Volume 1 (1998)
   December
   November
   October
   September

 

JavaScript Tip:
Ask Visitors For Help

by Larisa Thomason,
Senior Web Analyst,
NetMechanic, Inc.

  
November 2003
(Part 2)
Vol. 6, No. 19
 • Design Tip
 • Promotion Tip
 • JavaScript Tip
  

Slow-loading pages annoy visitors, but another common Web site mistake is even worse: broken links. This bit of JavaScript makes it easy for visitors to report broken links. Invite visitors to alert you to problems before you lose credibility and customers!

Broken Links Reduce Credibility

It's aggravating to realize that you can spend hours creating a site navigation system and months working with other webmasters to build link popularity, only to have your credibility diminished when visitors find broken links on your site.

You can control your own site organization and your internal navigation system. However, you're helpless when thoughtless webmasters reorganize their sites and change file names or paths. Don't be a culprit yourself! Always check your backlinks before you make major structural changes to your site.

Unfortunately, Web site visitors blame YOU and not the other site when they find broken external links.

HTML Toolbox's Link Check feature alerts you to broken links, but it doesn't run continuously. Depending on how often you use it, you could have broken links on your site for a day, week, or even longer! A small amount of JavaScript code added to your custom error page gives you some added insurance. Use it to invite visitors to report broken links directly to you.

Use The Referrer Property

The JavaScript referrer property gives you the address of the referring page. That is, the page that the visitor was on immediately before visiting the current page. Our July 2001 Webmaster Tip discusses how to use the referrer property to track visits, personalize Web page content, direct visitors to a particular page, and advertise special offers.

In this article, let's learn another use for the referrer property: to enhance your custom error page. First, you'll have to learn how to create a custom error page if you don't already use one on your Web site.

Get The Referrer And Create A Mailto Link

We'll need to collect the address of the referring document (that's the broken link page causes the custom error document to appear).

NOTE: remember that the referrer property only works when the page is loaded on a live Web server. If you just try this technique on your local machine, you'll never see the referring URL appear on your error page.

Add this JavaScript code to the BODY section of the document:

<script language="javascript" type="text/javascript">
  if (document.referrer != '')
  document.write(document.referrer);
</script>

That adds the URL address for the broken link to the custom error page. Next, add a mailto link that invites your visitors to report the problem.

A basic mailto just contains your email address, but you can also add enhancements that define the subject, cc addresses, and even write text into the body of the document. Our September 2002 Webmaster Tip describes this in detail.

Create a mailto link that looks something like this:

<a href="mailto:YourName@YourSite.com? 
  &subject=Broken%20Link%20Report!">
	  Report this broken page!</a>

Here's an example page that contains one link. Click on the link to see how the referrer property works and a sample mailto link. Note: the example page doesn't link to a real custom error document because we already have one set up for the NetMechanic site.

The problem with a mailto link is that the visitor has to be motivated enough to actually click on the link, open the email client, and paste the broken link into the email. It is possible to handle this without email by using a form handling CGI script to process the form instead of a basic mailto link. Check with your Web host to see if you have access to a CGI form handling script.

But this is a quick and easy way to encourage visitors to report broken links and it doesn't require you to have access to any special scripts - just a custom error document. It's not as reliable as HTML Toolbox of course, but it just takes a little time and a few lines of code to add an extra element of safety to your site.



Rate This Tip:
Not Useful Useful Very Useful   
 
NetMechanic Tools
HTML Toolbox
Browser Photo
Server Check
Search Engine Starter
Search Engine Tools
GIFBot
Newsletter
HTML Tutorial and Tips
Search Engine Tutorial
Accessibility Information
Browser Problem Tutorial

Company Info
Products
About Us
Contact
Advertise
Link To Us
Jobs
Privacy Policy
Partner Programs
Press Room
RSS Feed
Support
 



Powered by Overture!

 
     
 
   
 
     


Keynote Home
Copyright © 1996-2007,
Keynote NetMechanic
All rights reserved.