# Javascript closing a greybox window



## scrubbicus (Jan 23, 2009)

hey I was wondering if anyone could help me out with something greybox related.

I'm trying to figure out some javascript that could 

1) change the parent window's page
2) close the greybox on page load

Any help would be appreciated, maybe on just how to close a popup and I can see if that could work. I've looked but couldn't find anything that worked.


----------



## Anthony:-P (Nov 24, 2006)

Hi Scrubbicus,

To close a greybox window, you'll want to use:

```
parent.parent.GB_hide();
```
To change the parent windows page, use something like:

```
parent.parent.document.location.href = 'the_url_goes_here';
```
Regards,
Anthony :up:


----------

