|
-
Dec 6th, 2001, 04:36 PM
#1
Thread Starter
Frenzied Member
window.close() & modal windows
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
-
Dec 7th, 2001, 05:22 AM
#2
Hyperactive Member
post your code and i'll sort it for you!!
-
Dec 7th, 2001, 12:17 PM
#3
Thread Starter
Frenzied Member
in the parent window I open the chile in a function like this:
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 + ');");
}
and this is the child's full code:
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
-
Dec 7th, 2001, 12:19 PM
#4
Hyperactive Member
Try getting rid of the space in JavaScript
Code:
<a href="java script:window.close()">Click Me</a>
should be
Code:
<a href="javascript:window.close()">Click Me</a>
-
Dec 7th, 2001, 12:21 PM
#5
Thread Starter
Frenzied Member
its not really there... vbforums adds that so we cant do anything bad. I noticed it once in another post.
Michael
-
Dec 7th, 2001, 12:21 PM
#6
Hyperactive Member
or maybe not seeing as the forum put that space in...LMAO
-
Dec 7th, 2001, 12:29 PM
#7
Hyperactive Member
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
-
Dec 7th, 2001, 12:33 PM
#8
Thread Starter
Frenzied Member
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
-
Dec 10th, 2001, 04:27 AM
#9
Hyperactive Member
I've got a solution for you M8,
instead of using
Code:
<a href="javascript:window.close()">close me</a>
use :
Code:
<a href="#" onclick="window.close()">close me</a>
This solution worked on my test page! let me know how you get on!
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|