例:
<frameset>
<frame id="frameA" name="frameA" src="a.jsp">
<frame id="frameB" name="frameB" src="b.jsp">
<frameset>
b.jsp中使frameA打开c.jsp:
var url = "c.jsp";
window.open(url,"frameA");
本文介绍如何使用JavaScript在网页中操作iframe元素,实现从一个iframe页面控制另一个iframe页面加载指定URL的功能。具体方法是在目标iframe页面中通过window.open方法并传入目标iframe的name属性来达到目的。
例:
<frameset>
<frame id="frameA" name="frameA" src="a.jsp">
<frame id="frameB" name="frameB" src="b.jsp">
<frameset>
b.jsp中使frameA打开c.jsp:
var url = "c.jsp";
window.open(url,"frameA");
1047

被折叠的 条评论
为什么被折叠?