View Full Version : OnLoad="window.opener.close();"???
TheJoshMan
02-20-2006, 04:44 PM
I have a pop up that has a media player in it... and i can get it to open fine... but what i am wanting is for it to close the parent window when it loads without having to click on a link... and also without asking the user if they want to close the parent window. Right now i'm using...
<a href="javascript:opener.close();">Close Previous Window</a>
Is this possible to put inside of the body tag like an onload function? I'm not getting it... Any help would be appreciated.
TheJoshMan
02-20-2006, 05:20 PM
Nevermind... I got it. It wasn't as hard as I thought it was... In case anyone else may ever be wondering how to do it here is the code...
<SCRIPT LANGUAGE="JavaScript">
window.open("Muzik.html","newWindow","menubar=no,resizable=no,dependent,status=no,width=350,HEIGHT=390,left=620");
window.opener = top;
window.close();
</SCRIPT>
That goes inside the head of the parent window... then this goes in the body tag of the parent window...
onload="newWindow()"
If I were you, I'd do it from the parent:
<a href="mediaplayer.html" onclick="window.open('mediaplayer.html');window.close();return false;" target="newwindow">Click</a>
TheJoshMan
02-23-2006, 01:58 AM
If I were you, I'd do it from the parent:
Well, I would... but this is for a page on myspace and myspace doesn't allow javascript so I had to use a sort of "Transition" page when they clicked on a link. Thanks anyway though.
sleipner
02-23-2006, 09:07 AM
what? Twey isnt going to say something about how language is deprecated and to use type instead? (the irony of it is, I just got done reading a thread with a post saying language is deprecated, and to use type instead)
Because I advised removing the whole tag. I guess I probably should have mentioned it anyway for information purposes. :)
Nyne: the language attribute is deprecated. Use type instead:
<script type="text/javascript">
TheJoshMan
02-23-2006, 09:13 PM
You mean to tell me that by changing the Language attribute to Type I can use it on MySpace????
Afraid not. Just for future reference as applied to <script> tags. :)
TheJoshMan
02-25-2006, 04:54 AM
I guess I misunderstood what you were trying to say. Thanks though.
Powered by vBulletin® Version 4.2.2 Copyright © 2019 vBulletin Solutions, Inc. All rights reserved.