window.open problem

G

Grouchy.Oldgit

Have been successfully using the following to open a pop-up for some
time

function msg(url) {

window.open(url,'msg','scrollbars=yes,menubar=yes,width=750,height=400,resizable=yes,toolbar=yes,location=yes,status=yes')
}

Works fine on IE6 & Firefox, but IE7 opens a new tab obscuring the
calling page. How can IE7 be made to open a new window?
 
P

PA Bear [MS MVP]

IE Tools | Internet Options | General | Tabs | Settings | When a pop-up is
encountered...

Lots more in IE Help! <wink>
 
J

Jeremy J Starcher

window.open (url,'msg','scrollbars=yes,menubar=yes,width=750,height=400,resizable=yes,toolbar=yes,location=yes,status=yes')
}

window.open is NOT required to open a new window. In most modern user
agents, the end use may choose to open window a new window, open a new
tab or ignore the request entirely.
 
G

Grouchy.Oldgit

Many thanks for prompt reply.

Unfortunately it seems that IE7 by default opens the link in a tab
rather than a pop-up! As most users probably never get past the
defaults, is there any way in javascript to force a link to open in a
pop-up?
 
R

rob^_^

Hi,

var
nwin=window.open(url,'msg','scrollbars=yes,menubar=no,width=750,height=400,resi­zable=yes,toolbar=no,location=yes,status=yes');
nwin.focus();
void(0);

Regards.
 
R

Richard Cornford

rob^_^ said:
var nwin=window.open(url,'msg','scrollbars=yes,menubar=no,width=750,
height=400,resi­zable=yes,toolbar=no,location=yes,status=yes');
nwin.focus();
void(0);
<snip>

So which part of that overrides the user's settings and forces IE 7 to
open a new window instead of opening a new tab to show the url?

And what is the - void(0); - statement supposed to do? Pure mystical
incantation or is there some reason for its being there?

It is often said that people who top-post don't bother reading what they
are replying to.

Richard.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Similar Threads


Members online

No members online now.

Forum statistics

Threads
473,754
Messages
2,569,528
Members
45,000
Latest member
MurrayKeync

Latest Threads

Top