Author Topic: Opening a popup without a parent ?  (Read 3536 times)

Opening a popup without a parent ?
on: September 24, 2007, 02:23:16 AM
I suspect this isnt too difficult to do, but Im afraid its beyond my limited skills and Id appreciate some advice.

All I want to do is pop up a small minimal web page window to keep on a corner of the desktop to monitor cctv.

Using Javascript I am able to generate the required popup but the trouble is the unwanted parent window still remains open after, and I cant find a way of closing the parent without a confirmation dialog popping up.

Is there a way to close the parent window without that confirmation dialog?

Or better still, is there a way to open a similar minimal bare-bones small popup directly without it having to be created by javascript from a parent window?

If not, is it perhaps possible to open the required monitor window directly as a normal window then modify all its relevent attributes afterwards (size, no scrollbars, no toolbar etc)?

Here is the existing code fragment to show how and what is being created by the parent using an on-click which passes...

  href="javascript:pop(http://popup.htm,500,400)"

to the following function...
 
SCRIPT language="JavaScript" type="text/javascript">
 function pop(s1,x1,y1) {
 nw = window.open(s1,"visiongs","width=" + x1 + ",height=" + y1 + ",scrollbars=no,scrolling=no,location=no,toolbar=no");
 }


That works ok as I said, except for having to close that parent window after.
 
Thanks in advance for any assistance you may come up with.

  • Offline neXus

  • Posts: 8,750
  • Hero Member
Re: Opening a popup without a parent ?
Reply #1 on: September 24, 2007, 11:18:54 AM
you got your window that you have opened, if both pages are yours, put this in the window you opened code...

Code: [Select]




And with the body

Code: [Select]


Been a while since I used it, should be right

Welcome to the forums

Re: Opening a popup without a parent ?
Reply #2 on: September 24, 2007, 14:04:54 PM
That still pops up the Close Window confirmation dialog Im afraid neXus.

  • Offline neXus

  • Posts: 8,750
  • Hero Member
Re: Opening a popup without a parent ?
Reply #3 on: September 24, 2007, 14:32:42 PM
Quote from: Electroguard
That still pops up the Close Window confirmation dialog Im afraid neXus.


Bar closing and getting it to ask if you want to close it is as far as you can go
You can click the hyperlink and have it open in the same window and resize it and so you only have one window open if that is any use?

Re: Opening a popup without a parent ?
Reply #4 on: September 24, 2007, 15:00:11 PM
Opening the popup in the same window would be fine, but could I then change all that windows required parameters (resize, no scroll bars, location or toolbars) from within itself to create the minimal popup, or must it keep what it inherited?
 
Thanks for welcoming me on board by the way.

  • Offline neXus

  • Posts: 8,750
  • Hero Member
Re: Opening a popup without a parent ?
Reply #5 on: September 24, 2007, 15:14:37 PM
You just do the same as you would opening a new window but when you create your function that run when you click the link you use the self of the page


Code: [Select]



As an example

Re: Opening a popup without a parent ?
Reply #6 on: September 24, 2007, 17:36:58 PM
Saw this earlier...

 "Toolbar - Sets whether or not the browsers tool bar is visible or not (can only be set before the window is opened and you must have UniversalBrowserWrite privilege)"

So unfortunately it looks like I can subsequently resize the window but not change its other attributes like No Toolbar after the window has been created.

Thanks for trying though, I appreciate your efforts.

Opening a popup without a parent ?
Reply #7 on: September 24, 2007, 18:23:37 PM
How about writing a small program to display the HTML content?

Opening a popup without a parent ?
Reply #8 on: September 24, 2007, 21:45:15 PM
I dont really know what sort of thing you had in mind DeltaZero, or if it could be done in my case, therefore perhaps the best thing might be for you to have a peek at the window yourself...

If you go to http://www.electroguard.kicks-ass.net/ and click theCCTV icon at the top-right of the page it will popup the monitoring window.

What Id like to do is pop up that window directly from a desktop icon if possible. That windows page isnt too complex but its size and style are important, and so far I have only been able to set these things by opening it with the appropriate parameters from a parent page.
If the Control Panel button is clicked though, then the ensuing page which inherits the same window is a real nightmare and took me many moons to get reasonably functional - it has links to my Homeseer home automation server (for issuing I/R and X10 commands for controlling cams and lights etc) as well as my video server.

If I could have a "small program" that could launch an appropiately sized chromeless window which could then then link to my existing popup page then that would certainly be the next best thing (cos it is local desktop specific) to being able to directly launch a chromeless self-sizing window, but I wouldnt know how to go about it Im afraid.

I did see something online earlier about creating HTA apps from HTM and Ive just been trying that out -  it almost works - I can change the style attributes to make the chromeless window... but not the relatively easy task (or so Id have thought) of resizing itself.
So near (which gives hope) yet still so far.

Opening a popup without a parent ?
Reply #9 on: September 24, 2007, 23:15:57 PM
If you can clarify what exactly you mean by chromeless I can make you a little something by way of an example that you can customise.

Opening a popup without a parent ?
Reply #10 on: September 24, 2007, 23:51:39 PM
What I mean by chromeless is just a simple closeable sized window with only a top-right X in the title bar to close it and no other fancies or wasted space.

Do you want the sizes and url or would I be able to tailor those after?

Opening a popup without a parent ?
Reply #11 on: September 25, 2007, 14:52:41 PM
Ill make something approx. based on the link above and give you the source code so you can play yourself.  Do you have visual studio? PM me your e-mail address if youd like

0 Members and 1 Guest are viewing this topic.