如何用js实现将一个页面内嵌到另一个页面

JavaScript017

如何用js实现将一个页面内嵌到另一个页面,第1张

很简单,如果是普通页面,就在A页面里用<iframe>这个标签即可

如果是SAP,那就直接在A页面里随便找个DIV,document.getElementById('divId').innerHTML = A即可

1、单纯的关闭

window.opener.location.reload() //刷新父窗口中的网页

window.close()//关闭当前窗窗口

2、提交后关闭

function save(){ 

    document.getElementById("pointsform").submit()

    alert('保存成功')

    window.opener.document.getElementById("cmd").value="query"

    window.opener.document.getElementById("form的id").submit()//提交

    window.close() //关闭当前窗口

}