I'm using greybox as a popup and everything works fine, except when i click on a link i get a scripting error. I have added this code to make greybox close and the main browser go to the page i want it to.

<a href="www.websitename.com" onclick="top.window.location.href='this.href';
parent.parent.GB_hide();">

When i click on the link greybox closes and the page redirects me to a page which says there's a scripting error.

Does anyone know how to fix this?

Thanks

If there's some reason why you don't simply do:

<a href="www.website.com" target="_top">

then
get rid of href on location and the quotes on this.href and parent.parent.GB_hide();
so it should look like:

<a href="www.websitename.com" onclick="top.window.location=this.href;">
Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.