Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 5 of 5
  1. #1
    New Coder
    Join Date
    Jul 2002
    Posts
    23
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Users Browser Homepage Default

    Is there a javascript that when a user clicks on the link (image) it plays a sound and then goes to the users default homepage in their browser?

  • #2
    jkd
    jkd is offline
    Senior Coder jkd's Avatar
    Join Date
    May 2002
    Location
    metro DC
    Posts
    3,163
    Thanks
    1
    Thanked 18 Times in 18 Posts
    (typeof window.home != 'undefined') ? window.home() : window.location.href = 'about:home';

    That will go to the homepage in IE4+ and NS4+.

  • #3
    New Coder
    Join Date
    Jul 2002
    Posts
    23
    Thanks
    0
    Thanked 0 Times in 0 Posts
    do i put this in the <head> of the html or the <body> of the html and do i have to put a <script> before and a </script> after the javascript you gave me or just put it in as posted.

  • #4
    jkd
    jkd is offline
    Senior Coder jkd's Avatar
    Join Date
    May 2002
    Location
    metro DC
    Posts
    3,163
    Thanks
    1
    Thanked 18 Times in 18 Posts
    <a href="#" onclick="(typeof window.home != 'undefined') ? window.home() : window.location.href = 'about:home';">go home</a>

    would be one way to apply it.

  • #5
    New Coder
    Join Date
    Jul 2002
    Posts
    23
    Thanks
    0
    Thanked 0 Times in 0 Posts
    thanks


  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •