function dosome(text){ document.getElementById("getText").innerHTML= decodeURI(text); } script>
b.html 代码如下:
无标题文档
这里是内容1
这里是内容2
这里是内容3
这里是内容4
这里是内容5
这里是内容6
window.onload = function(){ var text = document.getElementById('ct').innerHTML; document.getElementById('myfarme').src="http://www.a.com/c.html?content="+encodeURI(text); } script>
c.html 代码如下:
无标题文档
window.onload = function(){ var text = window.location.href.split('=')[1] console.log(parent.parent) parent.parent.dosome(text); } script>