PDA

View Full Version : Anyone here know javascript?



cruelpupet
01-01-2003, 05:01 PM
if you have a window opening with this code....


<script language='JavaScript'>
<!--
w=650;h=60;
function bpo(){var nw=window.open('http://banners.directnic.com/java.html','AS3498353688','width='+w+',height='+h);nw.focus();}
//-->
</script>



what would the code be to close the same window?

joepunk
01-01-2003, 06:09 PM
Do you want to close it or not open at all? I ask because I know if you put:

<script>function open(){return true;}</script>

then you will not have any popup's theoretically.

Otherwise the logical way to close the window in my experience would be to call:

nw.close();

But then again I don't really know javascript just java.

blueindian
01-01-2003, 06:13 PM
<script language='JavaScript'>
<!--
w=650;h=60;
var nw;
function bpo() nw=window.open('http://banners.directnic.com/java.html','AS3498353688','width='+w+',height='+h);nw.focus();}
//-->
</script>

delcare nw outside the script. then use nw.close to close the window.

Burzhui
01-01-2003, 06:13 PM
javascript:window.close();

Burzhui
01-01-2003, 06:17 PM
what do you need exactly though?

blueindian
01-01-2003, 06:21 PM
Originally posted by Burzhui
javascript:window.close();

that won't work. that would attempt to close the parent window, rather than the child. to close the child, you have to refer to it by name or other convention.

x1337xD335C1P13x
01-01-2003, 06:59 PM
Originally posted by blueindian
<script language='JavaScript'>
<!--
w=650;h=60;
var nw;
function bpo() nw=window.open('http://banners.directnic.com/java.html','AS3498353688','width='+w+',height='+h);nw.focus();}
//-->
</script>

delcare nw outside the script. then use nw.close to close the window.


I agree with blueindian

cruelpupet
01-01-2003, 07:10 PM
What I want to do is close a popup that is automatically inserted into my website by the hosting company

cruelpupet
01-01-2003, 07:14 PM
Looks like JoePunks suggestion of



<script>function open(){return true;}</script>

works



Thanks JoePunk


and http://www.helpageekgetlaid.com thanks you too