Forum Moderators: open

Message Too Old, No Replies

Getting Home

Need to redirect users to their 'home page'.

         

Jim_Brija

3:15 pm on Feb 8, 2002 (gmt 0)



I know there is a 'window.home()' command in JS to basically mimic the 'home' button on the user's browser. What is the correct syntax (do you need to set a variable to 'window.home()', or just have the command in a function ?

andron

4:07 pm on Feb 8, 2002 (gmt 0)

10+ Year Member



I found this, you may want to work with it a bit....

<script language=javascript>
<!--
function gohome(){
//if NS 4+
if(document.layers) window.home()
//else if IE 4+
else if (document.all) window.location="about:home"
else alert("You need NS 4+ or IE 4+ to go back home!")
}
//-->
</script>

Then use this to create the link:

<a href="javascript:gohome()">Home</A>

joshie76

4:24 pm on Feb 8, 2002 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Or this <a href="http://www.msn.com">home</a> ;)

andron

4:26 pm on Feb 8, 2002 (gmt 0)

10+ Year Member



Wow Josh, how did you know that that was my homepage? ;)

Jim_Brija

4:39 pm on Feb 8, 2002 (gmt 0)



That's my home page too !!!

BUT, I can't count on that. I need to go to THAT PERSON'S home page.

joshie76

4:42 pm on Feb 8, 2002 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Hi Jim, Welcome to WmW

Sorry, I was being sarcastic - though I think andron's script should sort you out. Out of interest, may I ask why?

Jim_Brija

5:52 pm on Feb 8, 2002 (gmt 0)



That's cool Joshie. If you can't have a sense of humor in this business, you'll go crazy sometimes.

The reason why I need this : A customer with too much time on their hands. They like to keep us busy.