1. Advertising
    y u no do it?

    Advertising (learn more)

    Advertise virtually anything here, with CPM banner ads, CPM email ads and CPC contextual links. You can target relevant areas of the site and show ads based on geographical location of the user if you wish.

    Starts at just $1 per CPM or $0.10 per CPC.

Stuck at this php/js trick. Can Someone help me?

Discussion in 'PHP' started by niravdave, Dec 3, 2011.

  1. #1
    Hi Guys,

    I am stuck at one of this trick done in JS on PHP. I have been trying to figure out a solution for it but have been unsuccessful.

    When a user clicks on "View Code & Open Site", the new browser opens in a new tab in the background. the current tab stays as is. Can someone help me in figuring how this is done?

    http://www.promotionalcodes.org.uk/argos

    Help much appreciated.

    Thanks
    Dave
     
    niravdave, Dec 3, 2011 IP
  2. xaptronic

    xaptronic Peon

    Messages:
    1
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #2
    It uses a pop under. Usually something like
    // opens the new window
    var a = window.open('somepage','','window.open options')
    // blur the opened window
    a.blur()
    // return focus to this window (the opener)
    window.focus()

    You'll notice that this doesnt work quite right in firefox as firefox 3.6+ (4 and up) have disabled the use of focus, and various resize methods.
     
    xaptronic, Dec 3, 2011 IP