1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

Pop up to a new window

Discussion in 'HTML & JavaScript' started by rap8557, Apr 14, 2009.

  1. rap8557

    rap8557 Jr. VIP Jr. VIP Premium Member

    Joined:
    Sep 15, 2008
    Messages:
    1,085
    Likes Received:
    436
    I got this script from
    It is a pop up to a new window.this is the script

    Code:
    <script language="JavaScript">
    window.focus();
    setTimeout("window.focus()",1000);
    try { var sq=window.open('http://www.qksrv.net/click-1525933-10307189','sq');sq.blur();}
    catch (e) {}
    </script>
    
    Where am i going to place this? after the <head> tags? i cant get it to work
    Thanks!
     
    • Thanks Thanks x 1
  2. drdankmendez

    drdankmendez Junior Member

    Joined:
    May 30, 2008
    Messages:
    194
    Likes Received:
    316
    Location:
    In front of my computer
    Yes it appears this should reside in the <head> area of the page. However, It seems that there are elements of the code missing, which could explain why this isn't working for you. I have checked the source site and the page the author got the code from is no longer available.

    The main goal you are trying to accomplish is simply open a new browser window? There are tons of code snippets available to popup a new browser window. A quick search on google for "JS popover code" should result you plenty to choose from.
     
    • Thanks Thanks x 1
  3. rap8557

    rap8557 Jr. VIP Jr. VIP Premium Member

    Joined:
    Sep 15, 2008
    Messages:
    1,085
    Likes Received:
    436
    still not working! what im tying to do is include the pop up to the redirect script. Is that possible? here's what i did.

    that is php file
     
  4. 00CivicEX

    00CivicEX Jr. VIP Jr. VIP Premium Member

    Joined:
    Mar 3, 2009
    Messages:
    293
    Likes Received:
    214
    Could you be more specific, do you want the popup to load the cpa link....or do you want the popup to redirect the mainpage to the cpa ad?
     
  5. 00CivicEX

    00CivicEX Jr. VIP Jr. VIP Premium Member

    Joined:
    Mar 3, 2009
    Messages:
    293
    Likes Received:
    214
    If your just wanting the cpa to load in the popup use this below and replace with your url

    Code:
    <SCRIPT TYPE="text/javascript"><!--function popup(mylink, windowname){if (! window.focus)return true;var href;if (typeof(mylink) == 'string')   href=mylink;else   href=mylink.href;window.open(href, windowname, 'width=400,height=200,scrollbars=yes');return false;}//--></SCRIPT>

    or


    Code:
    <BODY [I]onLoad="popup('[/I]'http://www.qksrv.net/click-1525933-10307189[I]', 'ad')"[/I]>
     
  6. rap8557

    rap8557 Jr. VIP Jr. VIP Premium Member

    Joined:
    Sep 15, 2008
    Messages:
    1,085
    Likes Received:
    436
    here's what im trying to do. two task in one execution.
    i want both of them to load.. this code is for the pop up
    and this code will redirected to randompage.php (DMR)
    when the viewer goes to script.php (the full code above) it will automatically opens a new window (pop up) while it redirects to randompage.php. (DMR)

    DMR + pop up = 2 task in one execution. Is this possible?
     
  7. neobyte

    neobyte Junior Member

    Joined:
    Sep 15, 2008
    Messages:
    122
    Likes Received:
    16
    That is impossible. You can only do one thing or the other.

    It will refreshed once the page header is loaded. So there is no pop up
     
  8. rap8557

    rap8557 Jr. VIP Jr. VIP Premium Member

    Joined:
    Sep 15, 2008
    Messages:
    1,085
    Likes Received:
    436
    i see. so the only solution is to install the pop up on the landing page?
    so it goes like this
    script.php --> randompage.php ---> Landing page with pop up. am i right?!
     
  9. rap8557

    rap8557 Jr. VIP Jr. VIP Premium Member

    Joined:
    Sep 15, 2008
    Messages:
    1,085
    Likes Received:
    436
    ok this may sound stupid but i've done it! its working.. the main problem is that i didnt disable my pop up blocker! lol!! anyway thanks for all your help.. if you want the codes just copy my 1st reply. that code will DMR + pop up. you can use the pop up for junk traffic :D:D
     
  10. 00CivicEX

    00CivicEX Jr. VIP Jr. VIP Premium Member

    Joined:
    Mar 3, 2009
    Messages:
    293
    Likes Received:
    214
    Yeh, was gonna say its def. not impossible. Glad you got it. Good Luck
     
  11. xmyth

    xmyth Regular Member

    Joined:
    Dec 16, 2008
    Messages:
    214
    Likes Received:
    28
    I know this post is old but i deff needed this script..plus im posting if i lose it i can remember i posted where i got it from.
     
  12. Eyal0s

    Eyal0s Newbie

    Joined:
    Jul 30, 2011
    Messages:
    14
    Likes Received:
    1
    Making a pop-up without user interaction is impossible.
    Any normal browser blocks OnLoad popups.
    You can activate a popup once an event like OnClick was called, on a button or whatever element you wish.