SitePoint Sponsor

User Tag List

Results 1 to 8 of 8
  1. #1
    SitePoint Enthusiast
    Join Date
    Feb 2006
    Posts
    76
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Question window.open referer ??

    Hi

    Please i want to know if thier is anyway i can show the refere on window.open button
    like:

    Code:
    <input type=button name="open" value="Open" onClick='window.open("http://www.sitepoint.com")'>
    it never shows from where it has been clicked it give a blank referer

    Thanks alot

  2. #2
    SitePoint Evangelist SpaceFrog's Avatar
    Join Date
    Jan 2005
    Location
    Outerspace
    Posts
    511
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    opener ?

  3. #3
    SitePoint Evangelist
    Join Date
    Sep 2003
    Location
    San Diego, CA
    Posts
    591
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Do you want to get the referrer of the page that opened it, or the page the user clicked the button on to open the popup?

  4. #4
    SitePoint Enthusiast
    Join Date
    Feb 2006
    Posts
    76
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    i want to konw from where they came on the opened page to make sure they came from this button

    or how can i make a button open in a new windows any ideas?

  5. #5
    SitePoint Evangelist SpaceFrog's Avatar
    Join Date
    Jan 2005
    Location
    Outerspace
    Posts
    511
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    well that's what we are trying to tell you ...

    PHP Code:
    if (self.opener=="mypage.htm"

  6. #6
    SitePoint Member
    Join Date
    Jul 2004
    Location
    Albert District
    Posts
    2
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    i have the same problem as free dragon.
    when links are opened from javascript:window.open the referer variable is not transmitted. anyone knows a solution?
    See my portfolio and resume

    Omnia Vincit Amor
    "Love Conquers All"

  7. #7
    Programming Since 1978 silver trophybronze trophy felgall's Avatar
    Join Date
    Sep 2005
    Location
    Sydney, NSW, Australia
    Posts
    16,788
    Mentioned
    25 Post(s)
    Tagged
    1 Thread(s)
    The referrer value is under the control of your visitors. If they set their browser or firewall to blank the referrer then there is nothing you can do.
    Stephen J Chapman

    javascriptexample.net, Book Reviews, follow me on Twitter
    HTML Help, CSS Help, JavaScript Help, PHP/mySQL Help, blog
    <input name="html5" type="text" required pattern="^$">

  8. #8
    SitePoint Enthusiast pentapenguin's Avatar
    Join Date
    Aug 2005
    Location
    GA, USA
    Posts
    60
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    You can always manually add a referrer in the URL like this:
    Code:
    <input type=button name="open" value="Open" onClick='window.open("http://www.sitepoint.com?referrer=mysite")'>


Bookmarks

Posting Permissions

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