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
Printable View
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
post your code and i'll sort it for you!!
in the parent window I open the chile in a function like this:
and this is the child's full code:Code: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 + ');");
}
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.Code:<HTML>
<HEAD>
<TITLE></TITLE>
</HEAD>
<BODY>
<a href="javascript:window.close()">Click Me</a>
</BODY>
</HTML>
thanks in advance,
Michael
Try getting rid of the space in JavaScript
should beCode:<a href="java script:window.close()">Click Me</a>
Code:<a href="javascript:window.close()">Click Me</a>
its not really there... vbforums adds that so we cant do anything bad. I noticed it once in another post.
Michael
or maybe not seeing as the forum put that space in...LMAO ;)
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
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
I've got a solution for you M8,
instead of using
use :Code:<a href="javascript:window.close()">close me</a>
This solution worked on my test page! let me know how you get on! :cool:Code:<a href="#" onclick="window.close()">close me</a>