Reputation: 1
I have a thickbox appearing and have created a button which points to a new URL. I want it to work in the following way: 1. Click the button 2. Close the thickbox 3. Set parent window to new url.
I have succeeded in closing the thickbox but cannot get it to open the new url. The code I'm using is as follows: a onclick="javascript:self.parent.tb_remove(); parent.location.href=(this).href(www.google.com.au)"
Cheers,
Shap
Upvotes: 0
Views: 958
Reputation: 32367
this
in the context of a javascript event handler refers to the actual element itself. So you're basically setting the href attribute of the element itself. You want to set the location of the window as @nvl points out, so that would be
window.parent.location.href = "http://www.google.com.au";
Upvotes: 0