Pop Up And New Page Code?

by 3 replies
4
If you go to this site :http://www.retailmenot.com/view/jcpenney.com
and if you click on one of those coupons it opens new window tab and pop up window with the coupon code.

I am trying to make something similar. I am not a programmer so i searched for possible solutions and i'v found this code:

<a href="http://www.yahoo.com" onclick="javascript:void window.open('http://www.yahoo.com','1351633016625','width=250,height=5 00,toolbar=0,menubar=0,location=0,status=1,scrollb ars=1,resizable=1,right=0,top=0');return false;">Pop-up Window</a>

or you can see it in action here: Pop

What i am trying to make is to add or change something in the code so when i click on it, it should open a new window tab(with different site, for example google.com) and in pop up window to be yahoo.com. Is there any way to add something or change in this code to achieve this result?
#programming #code #page #pop
  • How about this?
    Code:
    <a href = "#" target = "_blank" onclick="javascript:void window.open('http://www.yahoo.com','1351633016625','width=250,height=5 00,toolbar=0,menubar=0,location=0,status=1,scrollb ars=1,resizable=1,right=0,top=0'); window.open('http://www.google.com', 'blank'); return false;">Pop-up Window</a>
    I added the bolded part and replaced what was after href with the # sign.

    It worked on my computer.

    Sergiu FUNIERU
    • [ 1 ] Thanks
    • [1] reply
    • Thanks, it works, is there any way this pop up(yahoo) to be in front of new window tab (google)?
  • >>> Thanks
    You're welcome.

    >>> is there any way this pop up(yahoo) to be in front of new window tab (google)?
    Well, in Firefox 3.6, even the code from my previous reply works the way you want. But, the version below works even in Chrome and IE 7.

    I opened the google window first, and I changed "top" property for the yahoo window, from 0 to 1. I also removed the void word which was after "javascript" - I'm not sure why it was there.

    Here's the new code. Please confirm if that's what you had in mind.
    Code:
    <a href = "#" target = "_blank" onclick="javascript: window.open('http://www.google.com', 'blank'); window.open('http://www.yahoo.com','1351633016625','width=250,height=5 00,toolbar=0,menubar=0,location=0,status=1,scrollb ars=1,resizable=1,right=0,top=1'); return false;">Pop-up Window</a>
    Sergiu FUNIERU

Next Topics on Trending Feed