www.webdeveloper.com
Results 1 to 6 of 6

Thread: Is it possible to send a user to their homepage?

  1. #1
    Join Date
    Apr 2010
    Posts
    6

    Is it possible to send a user to their homepage?

    I would like to know if it is possible to find out a users homepage, extract that information, and use it to send the user back to their homepage when they exit my site. I've searched for this info multiple times, using multiple parameters, but so far everything says I can only link to another page.
    Your help and insights are greatly appreciated,
    mitchellA

  2. #2
    Join Date
    Sep 2008
    Location
    Connecticut
    Posts
    123
    I don't believe you can accomplish this with html. You might want to try posting in the Javascript forum or one of the server-side forums.

  3. #3
    Join Date
    Jan 2007
    Location
    Wisconsin
    Posts
    2,120
    99% sure you can't do this.
    Jon Wire

    thepointless.com | rounded corner generator

    I agree with Apple. Flash is just terrible.

    Use CODE tags!

  4. #4
    Join Date
    Nov 2002
    Location
    Flint, Michigan, USA
    Posts
    597
    "Learning a user's homepage" and "sending him to his homepage" are separate questions. I don't know of any way of doing the first; for the second:

    For Netscape, Opera, and Firefox:
    <input type="button" value="Home Page" onclick="javascript:home();">
    For Internet Explorer:
    <input type="button" value="Home Page" onclick="javascript:document.location='about:home';">
    Please give me a hand at http://www.gofundme.com/bkzr98.

  5. #5
    Join Date
    Feb 2010
    Posts
    184
    javascript:home(); works in firefox 3.6.4

    javascript:document.location='about:home'; doesn't work in ie8

    There doesn't seem to be anything for safari or chrome.

    For firefox and ie you can use:

    Code:
    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
    <html XMLNS:IE>
      <head>
        <title></title>
        <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
        <script type="text/javascript" src="js/jquery-1.4.2.min.js"></script>
        <style type="text/css">
        @media all {
           IE\:homePage {behavior:url(#default#homepage)}
        }
        </style>
        <script type="text/javascript">
          function go_home(){
            if(typeof(oHomePage) !== 'undefined' && typeof(oHomePage.navigateHomePage) !== 'undefined') oHomePage.navigateHomepage();
            else if(window.home) window.home();
            else alert('Not supported, use your browser');
          }
        </script>
      </head>
      <body>
        <IE:homePage ID="oHomePage" />
        <div>
          <input type="button" value="home page" onclick="go_home()" />
        </div>
      </body>
    </html>
    It may be better to provide a dropdown with a list of the most popular/common homepages, since the above code will not validate and has plenty of cross browser compatibility problems.

  6. #6
    Join Date
    Aug 2007
    Posts
    3,767
    Quote Originally Posted by letmehaveago View Post
    It may be better to provide a dropdown with a list of the most popular/common homepages, since the above code will not validate and has plenty of cross browser compatibility problems.
    If you want them back, it would be best to let them choose where they want to go, not dictate that they must go to their homepage.
    Great wit and madness are near allied, and fine a line their bounds divide.

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Posting Permissions

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



Recent Articles