开发者

How can I navigate my Facebook iframe with a button in javascript?

开发者 https://www.devze.com 2023-02-17 20:13 出处:网络
Usually one wou开发者_如何学JAVAld use: document.location = \'http://www.mozilla.org\'; or window.frames[0].location.href = \'http://www.google.com/\';

Usually one wou开发者_如何学JAVAld use:

document.location = 'http://www.mozilla.org';

or

window.frames[0].location.href = 'http://www.google.com/';

But the window and document objects dont seem to be accessible from my facebook iframe app. I even tried having an empty link getting that and calling click() on it but the <a> element doesnt support that method..


Here you go:

top.location.href = 'http://www.mozilla.org';

To change the iframe only:

location.href = 'http://www.mozilla.org';

Result:

How can I navigate my Facebook iframe with a button in javascript?

0

精彩评论

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

关注公众号