Re: FAQ Topic - How do I open a new window with javascript? (2008-03-27)
- From: Dr J R Stockton <jrs@xxxxxxxxxxxxxxxxxx>
- Date: Thu, 27 Mar 2008 14:26:02 +0000
In comp.lang.javascript message <47eae387$0$90267$14726298@xxxxxxxxxxxxx
dk>, Thu, 27 Mar 2008 00:00:02, FAQ server <javascript@xxxxxxxxxxxxxx>
posted:
-----------------------------------------------------------------------
FAQ Topic - How do I open a new window with javascript?
-----------------------------------------------------------------------
New windows can be opened on browsers that support the
` window.open ` function and are not subject to the action of any
pop-up blocking mechanism with code such as:-
if(window.open){
wRef = window.open("http://example.com/page.html","windowName");
}
http://developer.mozilla.org/en/docs/DOM:window.open
http://www.infimum.dk/HTML/JSwindows.html
That needs re-thinking and re-writing.
My MS IE 7 is certainly subject to the action of a pop-up blocking
mechanism, yet it can certainly open new windows.
There seems to be four (or more) distinct cases to consider : the first
parameter of window.open can be an empty string (""), or it can be a
relative reference ("sibling.htm"), or it can be a full reference
("http://...") to the same site, or it can be a full reference
("http://...") to a different site.
As a first step, I suggest (note spaces in code, for legibility) :
New windows can be opened on browsers that support the ` window.open `
method with code such as :-
if (window.open)
wRef = window.open(
"http://example.com/page.html", "windowName", "windowFeatures")
Opening new windows is often prevented by a pop-up blocker.
--
(c) John Stockton, nr London UK. ?@merlyn.demon.co.uk BP7, Delphi 3 & 2006.
<URL:http://www.merlyn.demon.co.uk/> TP/BP/Delphi/&c., FAQqy topics & links;
<URL:http://www.bancoems.com/CompLangPascalDelphiMisc-MiniFAQ.htm> clpdmFAQ;
<URL:http://www.borland.com/newsgroups/guide.html> news:borland.* Guidelines
.
- References:
- FAQ Topic - How do I open a new window with javascript? (2008-03-27)
- From: FAQ server
- FAQ Topic - How do I open a new window with javascript? (2008-03-27)
- Prev by Date: Re: Double combo
- Next by Date: Re: Mozilla vs IE spacing
- Previous by thread: FAQ Topic - How do I open a new window with javascript? (2008-03-27)
- Next by thread: Double combo
- Index(es):
Relevant Pages
|