<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<%
String path = request.getContextPath();
String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";
%><!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<base href="<%=basePath%>">
<title>My JSP 'index.jsp' starting page</title>
<meta http-equiv="pragma" content="no-cache">
<meta http-equiv="cache-control" content="no-cache">
<meta http-equiv="expires" content="0">
<meta http-equiv="keywords" content="keyword1,keyword2,keyword3">
<meta http-equiv="description" content="This is my page">
<!--
<link rel="stylesheet" type="text/css" href="styles.css">
-->
<script type="text/javascript">
window.οnlοad=function(){
var oInput =document.getElementById('input1');
var oIframe =document.getElementById('iframe1');
oInput.οnclick=function(){
alert(oIframe.contentWindow);/获取window对象
//oIframe.contentWindow.document.getElementById('div1').style.color='red';ie都支持
oIframe.contentDocument.getElementById('div1').style.background='red';//ie6,7不支持
}
}
</script>
</head>
<body>
<input type="button" value="改变" id="input1" />
<iframe src="left.jsp" id="iframe1"></iframe>
</body>
</html>
//******************************************
<%@ page language="java" import="java.util.*" pageEncoding="utf-8"%>
<%
String path = request.getContextPath();
String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";
%><!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<base href="<%=basePath%>">
<title>My JSP 'left.jsp' starting page</title>
<meta http-equiv="pragma" content="no-cache">
<meta http-equiv="cache-control" content="no-cache">
<meta http-equiv="expires" content="0">
<meta http-equiv="keywords" content="keyword1,keyword2,keyword3">
<meta http-equiv="description" content="This is my page">
<!--
<link rel="stylesheet" type="text/css" href="styles.css">
--> </head>
<body>
<div id="div1">aaa</div>
</body>
</html>
父页面修改子页面元素
原创
©著作权归作者所有:来自51CTO博客作者wx360w684er9d的原创作品,请联系作者获取转载授权,否则将追究法律责任
提问和评论都可以,用心的回复会被更多人看到
评论
发布评论
相关文章
-
子页面修改父页面元素或顶层页面元素
String
html java css -
jQuery父页面调用子页面元素 jquery 获取父元素的子元素
使用js或者jquery查找父元素、子元素经常遇到。可是用起来总容易混淆,这里统一总结了一下,以后用起来相信会方便好多这里jquery向上查找父元素 用到的方法:closest() parents() parent() &n
jQuery父页面调用子页面元素 jquery javascript html d3