Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chriss Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Intranet Application - trying to close main window

Status
Not open for further replies.

XgrinderX

Programmer
Mar 27, 2001
225
US
Hello!

I am writing an application that is going to be run on a local Intranet. I want to load the default page which is really just the application launcher. It opens a new featureless window (no menu bar, no toolbar, no address bar, etc) which contains the application. I then want to close the launcher window. But every time I do, I get the message, "The Web page you are viewing is trying to close the window".

So I added some code to the end of my launcher page that looks like this:

window.opener = self;
window.opener.close();

This works on some machines but not on others and I do not know why. Is there some way to tell IE that this is an Intranet application and that its ok for me to be able to close that window myself?

Thanks in advance for any help you can offer.

-Greg
 
Not easily, I suspect. Is it important to close the main window? Why not have it populate with your "thanks for playing!" screen, such that when they finish playing with the extruded application and close the window, they're faced with a "thank you" window?

Cheers,


[monkey] Edward [monkey]

"Cut a hole in the door. Hang a flap. Criminy, why didn't I think of this earlier?!" -- inventor of the cat door
 
Well....the reason we want it to close is because it still has the Menu Bar and Address Bar and all that stuff displayed which gives users the opportunity to get into IE and goof things up. That's why we want that window to close itself down.

Maybe there is another way to do this?
 
on the main page try this.

self.opener = this
self.close()

Programming today is a race between software engineers striving to build better and bigger idiot-proof programs, and the Universe trying to produce bigger and better idiots. So far, the Universe is winning. - Rick Cook
 
I'm not so sure it is much different, just thought you could try it.

I think yours is an elaborate way to say self.close() while mine is reseting the opener of the page to the page itself and then closing.

Programming today is a race between software engineers striving to build better and bigger idiot-proof programs, and the Universe trying to produce bigger and better idiots. So far, the Universe is winning. - Rick Cook
 
how about:

location = closePage.html

then have closePage.html's body onLoad = "window.close();"

kind of messy, but it should work
 
>>This works on some machines but not on others and I do not know why

It's because some machines have a security vulnerability that allows you to set the opener property of the window to itself.
 
most likely the machines that are not cooperating are < IE5.5 - this only works on IE5.5+





=========================================================
try { succeed(); } catch(E) { tryAgain(); }
-jeff
 
>>It's because some machines have a security vulnerability that allows you to set the opener property of the window to itself.

Hmmm...that woul be weird. The ones that work are all IE6, the ones that don't work are all IE5.
 
>>most likely the machines that are not cooperating are < IE5.5 - this only works on IE5.5+

Yes, that's correct.

So is this window.opener workaround the only option? seems like IE should be able to be set up so that it gives a little more control for Intranet applications.
 
IE usually doesn't know or care about the location of the files and as a rule, web pages that kill themselves nudge close to the sort of functionality that really belongs in the hands of the user, instead of a script.

Did

Code:
self.opener = this
self.close()

work for you?

If you really want the ultimate kind of user control over your internal net web pages -- complete control over the viewing environment and variable scope and all that exciting &quot;application&quot; style stuff -- then you build an executable VB app and stick it on your server. Send your employees the link to the executable.

Cheers,


[monkey] Edward [monkey]

&quot;Cut a hole in the door. Hang a flap. Criminy, why didn't I think of this earlier?!&quot; -- inventor of the cat door
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top