Click to See Complete Forum and Search --> : document.title ? if/else statement


tribeman3819
10-16-2003, 10:07 AM
We use a tracking .js script on our sites now. The tracking script is in our content wrap/template, which is rendered before the content is. Our directories are blanketed with what we call the "wrap" where we overlay the wrap on certain dir. structures.
For example, in the site root, "sports/braves" would get a "Sports" wrap.

The problem is our 404 page is served from this directory "services/special" and the wrap that the incorrect url is called from is served. So if I type in http://www.sitename/sports/290378423098029kasjlkf;k.html(which is an invalid url), the "Sports" wrap is called and the content in the page is called from "services/special/404.html"

Is there a way to have the .js script check the <title> of the document and if it is equal to say "Page Not Found" that the tracking .js script does not print? We don't want to track 404 pages.

Any help is appreciated.

Jona
10-16-2003, 02:25 PM
window.onload = function(){if(document.title=="Document Not Found") top.location.href="http://sitename.com/"};


[J]ona