在父页面中嵌入子页面
<iframe id="headerIframe" src="header.jsp" width="100%" height="106" frameborder=0 border=0 marginheight=0 marginwidth=0 scrolling="no"></iframe>
JS中通过id获取子页面的点击事件,在父页面执行其他函数操作
document.getElementById("headerIframe").contentDocument.getElementById("btnLogin").οnclick=function(){
openLogin();
return false;
};