Mike.Duffy said the following on 11/30/2006 3:35 PM:
Quote:
Is there a trick you can use to know if someone has made your web page his
"home"?
Ask them.
Quote:
At first, I thought to check if ( history.length == 0 ) or if (
document.referrer.href == ""). [1]
Those are not reliable.
Quote:
These both sort of work, but can be fooled if the browser is launched from
another application, such as an external mail reader or newsreader.
Or if your homepage is set to about
:blank.
Quote:
[1] = Document.referrer is always empty for local disk "file://" urls. This
method will also be fooled if someone takes the time to type in (or
cut/paste) the url directly into the address bar.
My homepage for every browser I have is about
:blank and the
history.length is always 1 for the first page I open no matter how I
open it so checking history.length won't tell you. It also won't tell
you if I open the page via link with a target attribute or by right
clicking and choose to open it in a new window/tab.
--
Randy
Chance Favors The Prepared Mind
comp.lang.javascript FAQ -
http://jibbering.com/faq
Javascript Best Practices -
http://www.JavascriptToolbox.com/bestpractices/