2个纯html页面之间传值

1.indexMain.html 嵌套index.html;

name="child" id="child" src="aa.html" width=50% height = 50%>
1
<button onclick="myFunction()">点击这里</button>

function myFunction () {
var child_1 = document.getElementById(‘child’);
var win = child_1.contentWindow;
win.postMessage(“你好,js”,’*’);
}

2.在index.html里
window.onmessage = function(e){
e = e || event;
alert(e.data);
}

3.点击’点击这里’,弹出:你好,js

还有其他方式,参考:http://web.jobbole.com/88525/