2011/4/13 Sean Kinsey <oyv...@kinsey.no>:
> If there is an existing window open with the same name as referenced in the
> `window.open(url, name)` statement, then this window will normally be
> targeted instead of opening a new one (and having it blocked).
> This has lead me do the following; identify the name used by the blocked
> window.open code, and then on your site, in the users click action  open up
> a window with the same name. The window.open statement will now target the
> existing window and is therefor not blocked.
> You might need to open some document on the same domain as the window.open
> code tries, but a 404 should suffice in this case.
> Sean

You dont need to open a valid URL with window.open. The following will do:

var message = 'Opening page',
    win = window.open('javascript:"' + encodeURIComponent(message) +
'"', yourwindow),
    doc = window.document;
    doc.write('<!DOCTYPE HTML><html lang="en-US"><head><meta
charset="UTF-8"><title>' +
            message + '</title></head><body>' +
            message + '</body></html>');
    doc.close();

And then when some event happens, just:

win.location.replace('http://www.example.com/');

--
Poetro

-- 
To view archived discussions from the original JSMentors Mailman list: 
http://www.mail-archive.com/jsmentors@jsmentors.com/

To search via a non-Google archive, visit here: 
http://www.mail-archive.com/jsmentors@googlegroups.com/

To unsubscribe from this group, send email to
jsmentors+unsubscr...@googlegroups.com

Reply via email to