frame传参不用ajax的
//index.html
<style>
a {
display:block;
margin-bottom:20px;
width:30px;
}
iframe {
width:400px;
height:300px;
border:1px solid #000;
}
</style>
<script>
window.onload=function(){
document.getElementById('x').onclick=function(){
frames['_left'].document.getElementById('a').innerHTML=frames['_right'].document.getElementById('b').value.replace(/
\n/g,'<br />');
}
}
</script>
<a href="#" id="x">点</a>
<iframe name="_left" src="1.html"></iframe>
<iframe name="_right" src="2.html"></iframe>
//1.html
<div id="a" style="background:#000;color:#fff;width:300px;height:400px;"></div>
//2.html
<textarea id="b" style="width:300px;height:300px;">
测试
</textarea>
posted on 2008-07-30 16:15
bcterry 阅读(524)
评论(0) 编辑 收藏