最近需求越來越奇怪了 要在window.open()打開的頁面 點擊保存按鈕的時候 操作回顯父頁面的 百分比
查來查去 用window.opener方法解決 用到的方法主要有以下幾種
//相當於$("#..").html("...") window.opener.document.getElementById(id).innerHTML = html
//此爲操作父頁面中的函數window.opener.function window.opener.initEcharts(res.object,data);
//爲父頁面設置元素 相當於$("#..").attr("url",newUrl) window.opener.document.getElementById(id).setAttribute("url",newUrl);
//獲取父頁面的元素 相當於$("#..").attr("url") window.opener.document.getElementById(id).getAttribute("url");