hyperlink to default homepage?
Is this possible in a crossbrowser friendly way? what I need is an inpage hyperlink to take the user to their browser's default home page. Actually, I'll probably have the link got to a redirect page which takes the user to their home page if that makes a difference.
.....
mmi posted this at 16:33 — 16th April 2002.
They have: 457 posts
Joined: Jan 2001
hey taff - the code on this page worked for mme in N4.7 and IE5.5, but I get the alert in N6
Busy posted this at 05:25 — 17th April 2002.
He has: 6,151 posts
Joined: May 2001
just curious why you would want it going to users homepage, I dont know about anyone else but I use blank for mine, loads fast, no errors, as color you want as long as its white
taff posted this at 10:49 — 17th April 2002.
They have: 956 posts
Joined: Jun 2001
I was wondering if someone might ask that. My next questions will be about non-caching pages and the easiest way to wipe out site visits from history.
No, not going into the adult site biz.
Actually I'm developing a site for a domestic violence crisis center and one of their concerns is someone being caught visiting the site by an abuser. Each page will have a "panic button" to get them out quickly.
.....
mairving posted this at 11:35 — 17th April 2002.
They have: 2,256 posts
Joined: Feb 2001
If it is a panic button, why not make it just another site like yahoo, goggle, MSNBC, CNN. It would be much easier to code.
taff posted this at 11:41 — 17th April 2002.
They have: 956 posts
Joined: Jun 2001
Mairving: That is plan B. I just thought that the default home page would be a little safer than some site that might be deemed "out of character" for the user.
.....
doublehelix posted this at 13:23 — 17th April 2002.
They have: 117 posts
Joined: Feb 2002
I swiped bits and pieces of this and that and it seems to work. Probably needs some more testing though...
Panic Button
<script>
function gohome()
{
if (navigator.appName=="Netscape")
window.home()
else if (document.all)
window.location="about:home"
else
alert("You need NS 4+ or IE 4+ to go back home!")
}
</script>
Wil posted this at 13:23 — 17th April 2002.
They have: 601 posts
Joined: Nov 2001
Yeah. I also saw this code floating around on the web, too:
<script>
function gohome(){
if((navigator.appVersion.indexOf("4.") != -1) && (navigator.appName.indexOf("Netscape") != -1)){
home();}
}
</script>
<form><input type="button" value="Home" onClick="home();"></form>
- wil
doublehelix posted this at 13:25 — 17th April 2002.
They have: 117 posts
Joined: Feb 2002
I think -- considering your scenario -- I would add a document.open() to that to wipe out the current page in case there was some lag in loading the home page.
taff posted this at 16:13 — 17th April 2002.
They have: 956 posts
Joined: Jun 2001
Thanks guys, I'll test these out and let you know.
doublehelix: I was thinking of having the link actually go to a benign and quick loading redirect page first. This would hopefully minimalize the problem you refer to as well as add a bit of a buffer/deterrent to the back button of the browser.
.....
taff posted this at 21:01 — 1st May 2002.
They have: 956 posts
Joined: Jun 2001
Belated followup:
doublehelix's code works like a charm. Thanks a million!
Mike Feury posted this at 22:40 — 3rd May 2002.
They have: 48 posts
Joined: May 2002
Hi Taff,
I'm puzzled - why wouldn't users just use the browser Home button? Any link you put in is likely to be off-screen some of the time, so teaching them about the Home button sounds safer to me.
Mike
Want to join the discussion? Create an account or log in if you already have one. Joining is fast, free and painless! We’ll even whisk you back here when you’ve finished.