开发者

javascript and thickbox

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="javasc开发者_StackOverflow中文版ript:self.parent.tb_remove(); parent.location.href=(this).href(www.google.com.au)"

Cheers,

Shap


window.location.href = "http://www.google.com.au"


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";
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜