Re: FAQ Topic - How do I open a new window with javascript? (2008-03-27)



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
.



Relevant Pages

  • Re: Problem with slower startup of XP windows SP3
    ... Help and Support for details. ... The Panda Anti-virus Service has started successfully. ... The Windows Security Center Service has started. ... The local computer may not have the necessary registry information or message ...
    (microsoft.public.windowsxp.general)
  • Re: Problem with slower startup of XP windows SP3
    ... Event Viewer reports renders interpretation infinitely more difficult. ... see Help and Support Center at ... "Event Viewer in windows: ... Log on as an user with administrative rights and open Internet Explorer ...
    (microsoft.public.windowsxp.general)
  • Re: SP3 potential problem
    ... Where did you download the ATI drivers from? ... Select Start, Help and Support, Keep your Windows up- to-date with Windows Update, Review your Update History you can see the update. ... I have not been able to download Net Framework ...
    (microsoft.public.windowsxp.basics)
  • Re: OT: Arun Kishan
    ... The Windows ... In my experience the amount of necessary daily support is ... On VMS and unix, number of users on system is typically>1. ... Support person = ceil (1/(1 WEENDOZE user)) * WEENDOZE boxes. ...
    (comp.os.vms)
  • Re: older games dont work
    ... the support of my work have it and will burn a CD to me. ... and any other tips to make this game works will be great. ... Windows 95 including but not limited to: ... to map a pedal as a control ...
    (microsoft.public.windowsxp.games)