前景提要
HDC调试需求开发(15万预算),能者速来!>>>
网上教程全看过了,求看一下我这个到底是出了什么问题???
test.html
<!doctype html>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<meta name="Generator" content="EditPlus®">
<meta name="Author" content="">
<meta name="Keywords" content="">
<meta name="Description" content="">
<title>Document</title>
<script src="js/jquery-1.11.3.js"></script>
<style>
* {padding: 0; margin: 0;}
body,html {width: 100%; height: 100%;}
</style>
</head>
<body>
<iframe id="myFrame" name="myFrame" src="test2.html" frameborder="0"></iframe>
</body>
<script>
;$(function() {
var o = window.frames["myFrame"].document.getElementById("div1");
console.log(o);
});
</script>
</html>
test2.html:
<!doctype html>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<meta name="Generator" content="EditPlus®">
<meta name="Author" content="">
<meta name="Keywords" content="">
<meta name="Description" content="">
<title>Document</title>
<script src="js/jquery-1.11.3.js"></script>
<style>
* {padding: 0; margin: 0;}
body,html {width: 100%; height: 100%;}
#div1 {height: 200px; background: red;}
</style>
</head>
<body>
<div id="div1">
<p>123456</p>
</div>
</body>
<script>
$(function() {
})
</script>
</html>
我想知道为什么获取的null?????????????????????????
贴上教程:
http://blog.jjonline.cn/userInterFace/140.html
求大哥大姐测试过了,给小弟指点一下,参照我的源码,是在同域下的,不考虑跨域。。。