Click to See Complete Forum and Search --> : window.close() & modal windows
msimmons
Dec 6th, 2001, 03:36 PM
I have a modal window that I would like to close with the window.close() method. But it seems to open a new window instead,,, any suggestions. Maybe I just need to give up on the modal widnows because I can't seem to get them to work.
Michael
progressive
Dec 7th, 2001, 04:22 AM
post your code and i'll sort it for you!!
msimmons
Dec 7th, 2001, 11:17 AM
in the parent window I open the chile in a function like this:
function openthechild() {
var intWidth = document.body.offsetWidth / 2 - 225;
var intHeight = document.body.offsetHeight / 2 - 200;
taiWin = showModalDialog("test.asp", "TAI",
"status:no;resizable:no;help:no;scrollbars:no;dialogwidth:455px;dialogheight:360px, left:' + intWidth + ' top:' + intHeight + ');");
}
and this is the child's full code:
<HTML>
<HEAD>
<TITLE></TITLE>
</HEAD>
<BODY>
<a href="javascript:window.close()">Click Me</a>
</BODY>
</HTML>
all i want it to do at this point is close, then I will work on all my other problems :) But for now when you click on the 'click me' link it just makes the screen 'blink' like a new window was opened and closed really fast.
thanks in advance,
Michael
progressive
Dec 7th, 2001, 11:19 AM
Try getting rid of the space in JavaScript
<a href="java script:window.close()">Click Me</a>
should be
<a href="javascript:window.close()">Click Me</a>
msimmons
Dec 7th, 2001, 11:21 AM
its not really there... vbforums adds that so we cant do anything bad. I noticed it once in another post.
Michael
progressive
Dec 7th, 2001, 11:21 AM
or maybe not seeing as the forum put that space in...LMAO ;)
progressive
Dec 7th, 2001, 11:29 AM
Hmm strange that I get the same effect.
I've never used showModalDialog before, I'll have a play with this over the weekend!
It'll be monday when I get back to you I'm afraid Have a good weekend M8
msimmons
Dec 7th, 2001, 11:33 AM
I tried using the modal before on anoher app and wound up scraping it cos modal window didn't like what I was doing so I used a open.window made it chromeless, built chrome, and had a function to keep it on top... I'll probably have to do that all again.
Michael
progressive
Dec 10th, 2001, 03:27 AM
I've got a solution for you M8,
instead of using
<a href="javascript:window.close()">close me</a>
use :
<a href="#" onclick="window.close()">close me</a>
This solution worked on my test page! let me know how you get on! :cool:
vbforums.com
Copyright Internet.com Inc., All Rights Reserved.