开发者

How to reload, stop, back & forward a frame?

I got the follow开发者_StackOverflow中文版ing:

<frameset cols="20%,80%">
<frame src="zone1.htm" id="zone1">
<frame src="http://www.google.com" id="zone2">
</frameset> 

I got access to zone1.htm and the second frame is loaded from an external website, i want to do using javascript: Reload + Stop + Back + Forward Controls in zone1.htm to control the google frame.

I'm not sure if this is forbidden too by the same origin policy.

Thanks


window.history.forward()
window.history.back();
window.location.reload();

where window is the window object. A frame's window object can be access in this way:

frames.zone2.window;

Use name then, instead of ID. Or use numeric indexes: frames[0].window;

Today's browser often limit these features as a security enhancement (you don't want an advertisement to redirect you back the whole time)

0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜