Results 1 to 4 of 4

Thread: window.open and close immediately

  1. #1
    Join Date
    Sep 2007
    Posts
    6
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default window.open and close immediately

    Allright, first I'm going to explain what I want to achieve. I have a couple of websites, and one of them gets massive hits, so I want to "share" these hits with my other sites.

    Now I'm using some kind of a pop-under script, wich you can find here, to promote my other sites, but I want to get a step further. I want the pop-under to open and close immediatly, so that when someone cliks on my site, the other site also gets a hit.

    Hope you guys understand what I mean, and hope that someone can help me out on this one.

  2. #2
    Join Date
    Mar 2005
    Location
    SE PA USA
    Posts
    30,495
    Thanks
    82
    Thanked 3,449 Times in 3,410 Posts
    Blog Entries
    12

    Default

    If you are using this:

    Code:
    function goNewWin() {
    
    TheNewWin =window.open("http://www.yahoo.com",'TheNewpop','toolbar=1,location=1,directories=1,status=1,menubar=1,scrollbars=1,resizable=1');
    
    TheNewWin.blur();
    TheNewWin.close();
    
    }
    But, as I mentioned in that thread, it will not work in IE 7.

    However, in that thread you claimed you had no control over the pages in the new window. If they are the pages from your other site, you should. You can have script on those pages to close the window onload. Now, you might wonder, how can this page ever be seen then? As long as the window isn't opened with javascript, it cannot be closed with javascript.
    - John
    ________________________

    Show Additional Thanks: International Rescue Committee - Donate or: The Ocean Conservancy - Donate or: PayPal - Donate

  3. #3
    Join Date
    May 2007
    Location
    USA
    Posts
    373
    Thanks
    2
    Thanked 4 Times in 4 Posts

    Default

    You could try using iframes to load the page and make them invisible.
    Trinithis

  4. #4
    Join Date
    Mar 2005
    Location
    SE PA USA
    Posts
    30,495
    Thanks
    82
    Thanked 3,449 Times in 3,410 Posts
    Blog Entries
    12

    Default

    Quote Originally Posted by Trinithis View Post
    You could try using iframes to load the page and make them invisible.
    That's a pretty cool idea, instead of opening a new window onclick, which can always be blocked, and has (for the purposes of this exercise) other problems, you could have an iframe on the true destination page, and besides setting its position absolute and its visibility hidden, you could set its onload event to remove itself from the page.
    - John
    ________________________

    Show Additional Thanks: International Rescue Committee - Donate or: The Ocean Conservancy - Donate or: PayPal - Donate

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
  •