RE: [OT] Re: How to create a browser popup window
Title: RE: [OT] Re: How to create a browser popup window Hello, Thanks for all the window tips. I have fixed it with out using any javascript. just mention BASE TARGET=_blank in your html head and give TARGET=_self to the references which should be opened within the parent window. Thanks, Domien -Original Message- From: Rob Bloodgood [mailto:[EMAIL PROTECTED]] Sent: Tuesday, November 20, 2001 9:26 PM To: Nick Tonkin Cc: mod_perl Subject: RE: [OT] Re: How to create a browser popup window You must include code to deal with the fact that you may have already opened a popup window. Something like this: That is simply not true. window.open() with a named window ('popupwin', in your example) ALWAYS reuses that window, on every browser I've ever been able to test. The second call to window.open, with a new URL, simply refreshes the contents of the popup w/ the new URL. Note, this is *only* true for named windows. Windows without a window name string as the second parameter to window.open() will open a new window every time. It can, however, be a good idea to explicitly call focus() on your child window, because in the situation I've just mentioned, if the child window's url is refreshed, it is NOT automatically brought to the foreground. The original post was wondering how to put mod_perl output in a popup window. The answer is simply top call window.open() with the URL of the mod_perl handler as its location. If one is trying to be responsible about the window(s) being open, adding a link like a href="javascript:window.close()CLICK" HERE CLOSE THIS WINDOW/a in the child window is usually reasonably simple for the user to understand. Of course, the normal caveats about users understanding something still apply... A corrected version of your sample script follows. It's much simpler now... :-) SCRIPT LANGUAGE=JavaScript !-- Hide var popupwin = null; function popup(loc,ww,hh) { var mywidth = (ww + 10); var myheight = (hh + 10); var myspecs = 'menubar=1,status=1,resizable=1,location=1,titlebar=1,toolbar=1, scrollbars=1,width= + mywidth + ,height= + myheight + '; popupwin = window.open (loc, 'popupwin', myspecs); popupwin.focus(); } /SCRIPT A HREF='javascript:' Look at foo/A L8r, Rob #!/usr/bin/perl -w use Disclaimer qw/:standard/;
How to create a browser popup window
Title: How to create a browser popup window Hello all, Can anybody give me the golden tip of creating a popup browser window from my mod_perl handler? I want to fill in this popup window with results generated within my handler. Is there a module available from CPAN which can handle this? Thanks in advance! Met vriendelijke groet / With kind regards, Domien Bakker Application Developer Application development Operations and Engineering ZeelandNet BV Postbus 35 4493 ZG Kamperland The Netherlands tel. +31 (0)113 377733 fax +31 (0)113 377784 domien@staff.zeelandnet.nl http://ww.zeelandnet.nl/
Re: How to create a browser popup window
Title: How to create a browser popup window how do I unsubscribe from this list. - Original Message - From: Domien Bakker To: [EMAIL PROTECTED] Sent: Tuesday, November 20, 2001 6:30 AM Subject: How to create a browser popup window Hello all, Can anybody give me the "golden" tip of creating a popup browser window from my mod_perl handler? I want to fill in this popup window with results generated within my handler. Is there a module available from CPAN which can handle this? Thanks in advance! Met vriendelijke groet / With kind regards, Domien Bakker Application Developer Application development Operations and Engineering ZeelandNet BV Postbus 35 4493 ZG Kamperland The Netherlands tel. +31 (0)113 377733 fax +31 (0)113 377784 domien@staff.zeelandnet.nl http://ww.zeelandnet.nl/
Re: How to create a browser popup window
This is not really a mod_perl question. Pop-up windows can only be created using client-side scripting like Javascript. Your handler would need to output the necessary Javascript to cause the pop, like: script url = /pop/source.html; name = popwin; h = 250; w = 350; var theWin = window.open(url, name, 'scrollbars=yes, resizable=yes, toolbar=no, height='+h+', width='+w); theWin.focus(); /script For more information on how that works, read Javascript docs: http://developer.netscape.com/docs/manuals/?content=javascript.html From: Domien Bakker [EMAIL PROTECTED] Date: Tue, 20 Nov 2001 15:30:45 +0100 To: [EMAIL PROTECTED] Subject: How to create a browser popup window Hello all, Can anybody give me the golden tip of creating a popup browser window from my mod_perl handler? I want to fill in this popup window with results generated within my handler. Is there a module available from CPAN which can handle this? Thanks in advance! Met vriendelijke groet / With kind regards, Domien Bakker Application Developer Application development Operations and Engineering ZeelandNet BV Postbus 35 4493 ZG Kamperland The Netherlands tel. +31 (0)113 377733 fax +31 (0)113 377784 [EMAIL PROTECTED] http://ww.zeelandnet.nl/
[OT] Re: How to create a browser popup window
Off topic but in the interests of, if not less popup windows, then at least less broken ones: You must include code to deal with the fact that you may have already opened a popup window. Something like this: SCRIPT LANGUAGE=JavaScript !-- Hide var popupwin = null; function popup(loc,ww,hh) { var mywidth = (ww + 10); var myheight = (hh + 10); var myspecs = 'menubar=1,status=1,resizable=1,location=1,titlebar=1,toolbar=1,scrollbars=1,width= + mywidth + ,height= + myheight + '; if (popupwin == null || popupwin.closed) { popupwin = window.open (loc, 'popupwin', myspecs); } else { popupwin.close(); popupwin = window.open (loc, 'popupwin', myspecs); // If all your windows should be the same // size then comment out the above two lines and // uncomment the next two lines // popupwin.focus(); // popupwin.location.href = loc; } } /SCRIPT A HREF='javascript://' onClick='popup(foo.gif,300,200); 'Look at foo/A This one is good for calling with just an image as the href. You can use any code you like, including the other example posted here. Just remember to test whether you already have the window open or not and act appropriately. ~~~ Nick Tonkin On Tue, 20 Nov 2001, Ben Demonte wrote: How to create a browser popup windowhow do I unsubscribe from this list. - Original Message - From: Domien Bakker To: [EMAIL PROTECTED] Sent: Tuesday, November 20, 2001 6:30 AM Subject: How to create a browser popup window Hello all, Can anybody give me the golden tip of creating a popup browser window from my mod_perl handler? I want to fill in this popup window with results generated within my handler. Is there a module available from CPAN which can handle this? Thanks in advance! Met vriendelijke groet / With kind regards, Domien Bakker Application Developer Application development Operations and Engineering ZeelandNet BV Postbus 35 4493 ZG Kamperland The Netherlands tel. +31 (0)113 377733 fax +31 (0)113 377784 [EMAIL PROTECTED] http://ww.zeelandnet.nl/
RE: [OT] Re: How to create a browser popup window
You must include code to deal with the fact that you may have already opened a popup window. Something like this: That is simply not true. window.open() with a named window ('popupwin', in your example) ALWAYS reuses that window, on every browser I've ever been able to test. The second call to window.open, with a new URL, simply refreshes the contents of the popup w/ the new URL. Note, this is *only* true for named windows. Windows without a window name string as the second parameter to window.open() will open a new window every time. It can, however, be a good idea to explicitly call focus() on your child window, because in the situation I've just mentioned, if the child window's url is refreshed, it is NOT automatically brought to the foreground. The original post was wondering how to put mod_perl output in a popup window. The answer is simply top call window.open() with the URL of the mod_perl handler as its location. If one is trying to be responsible about the window(s) being open, adding a link like a href=javascript:window.close()CLICK HERE CLOSE THIS WINDOW/a in the child window is usually reasonably simple for the user to understand. Of course, the normal caveats about users understanding something still apply... A corrected version of your sample script follows. It's much simpler now... :-) SCRIPT LANGUAGE=JavaScript !-- Hide var popupwin = null; function popup(loc,ww,hh) { var mywidth = (ww + 10); var myheight = (hh + 10); var myspecs = 'menubar=1,status=1,resizable=1,location=1,titlebar=1,toolbar=1, scrollbars=1,width= + mywidth + ,height= + myheight + '; popupwin = window.open (loc, 'popupwin', myspecs); popupwin.focus(); } /SCRIPT A HREF='javascript:' onClick='popup(foo.gif,300,200)'Look at foo/A L8r, Rob #!/usr/bin/perl -w use Disclaimer qw/:standard/;
[OT] Re: How to create a browser popup window
On Tue, 20 Nov 2001, Rob Bloodgood wrote: You must include code to deal with the fact that you may have already opened a popup window. Something like this: That is simply not true. window.open() with a named window ('popupwin', in your example) ALWAYS reuses that window, on every browser I've ever been able to test. I didn't say duplicate windows was the problem. The problems are: 1) If the window exists it may have lost focus. 2) If the window exists you cannot resize it (eg for displaying full-size images from thumbnails, etc.) A corrected version of your sample script follows. It's much simpler now... So simple it only does half of what it did :) /THREAD ? - nick