
August 21st, 1999, 12:38 AM
|
|
Guest
|
|
Posts: n/a
Time spent in forums:
Reputation Power:
|
|
|
make index.html do this:
<body onload="document.location ='friend.html'">
and put this in index2.html:
function check(){
if(window.history.length == 2){
document.location = 'friend.html'
}
}
<body onload="check()">
window.history.length won't tell you if it's the homepage, but it will tell you how many pages have been opened in that window. The onload script in index.html forwards the user to index2.html so that if people bookmark your site, they are actually bookmarking index2.html. So in index2.html, we check() to see if we are the first page this window has loaded (if accessed via bookmark), or the second page. If they actually typed in the URL as their homepage they would have gone to index.html first, so now we know that IF the user has a home page set in their browser, then it is your homepage.
this code is not debugged, and I assume you can figure out how to add it to your site if it's worth it to you.
have fun
dan
|