can JS suss out "on-site" vs off-site HTTP requests?

Discussion in 'Javascript' started by Word Painter, Dec 5, 2006.

  1. Word Painter

    Word Painter Guest

    this may be more of an "html" issue, but I'll wing it.

    i've got a multi-language site, where the home-page of each language group
    features a link to a popup window that offers background info on site
    management. the popup is fired by a javascript function, when they click
    the site management link. there's also a "window close" function button so
    they can nuke it as they please.

    now, oddly, people who search for my site in the chinese language on google,
    are sent directly to the site management popup window, which of course,
    opens in their "full" browser window, and which also has no links back to
    the main site, because it's meant to open only as an "accessory" to the main
    site.

    my question is this: is there any way, with Javascript, that I could
    determine if they arrived at this window from "off-site" (ie, a google
    search), and therefore offer such "off-site" visitors a link back to the
    principal site, a link that would be hidden for visitors who clicked the
    popup window from my own site?

    hope this is not confusing...! Thanks for any help offered.


    WordPainter
    Word Painter, Dec 5, 2006
    #1
    1. Advertising

  2. Word Painter

    naixn Guest

    Word Painter wrote :
    > this may be more of an "html" issue, but I'll wing it.
    >
    > i've got a multi-language site, where the home-page of each language group
    > features a link to a popup window that offers background info on site
    > management. the popup is fired by a javascript function, when they click
    > the site management link. there's also a "window close" function button so
    > they can nuke it as they please.
    >
    > now, oddly, people who search for my site in the chinese language on google,
    > are sent directly to the site management popup window, which of course,
    > opens in their "full" browser window, and which also has no links back to
    > the main site, because it's meant to open only as an "accessory" to the main
    > site.
    >
    > my question is this: is there any way, with Javascript, that I could
    > determine if they arrived at this window from "off-site" (ie, a google
    > search), and therefore offer such "off-site" visitors a link back to the
    > principal site, a link that would be hidden for visitors who clicked the
    > popup window from my own site?
    >
    > hope this is not confusing...! Thanks for any help offered.
    >
    >
    > WordPainter
    >
    >


    http://developer.mozilla.org/en/docs/DOM:window.opener

    This may help you if you use window.open to open your link ;)
    It allow you to have a reference on the opener window. If none, it means it has
    been accessed directly, and then should be redirected.

    You also have the $_SERVER['HTTP_REFERER'] in PHP, and the equivalent may exist
    in many other web languages :)

    --
    Naixn
    http://fma-fr.net
    naixn, Dec 5, 2006
    #2
    1. Advertising

  3. naixn wrote:

    > You also have the $_SERVER['HTTP_REFERER'] in PHP, and the equivalent may
    > exist in many other web languages :)


    It is well known that Referer coding simply does not work on the Web, since
    not all UAs submit that header, depending on the security level and user
    preferences.


    PointedEars
    --
    Let us not judge others because of their religion, color or nationality.
    We are all just human beings living together on this planet. (poehoe.de)
    Thomas 'PointedEars' Lahn, Dec 11, 2006
    #3
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Fernando Arámburu

    web requests and mobile requests

    Fernando Arámburu, Apr 8, 2005, in forum: ASP .Net
    Replies:
    1
    Views:
    433
    Joerg Jooss
    Apr 8, 2005
  2. Steve
    Replies:
    0
    Views:
    442
    Steve
    Jan 31, 2006
  3. Janaka Perera

    Is there a way I can route http requests

    Janaka Perera, Nov 7, 2007, in forum: Java
    Replies:
    2
    Views:
    280
    Janaka Perera
    Nov 7, 2007
  4. Replies:
    0
    Views:
    159
  5. Dave Garcia
    Replies:
    5
    Views:
    547
    Dave Garcia
    Jun 5, 2009
Loading...

Share This Page