我在salesforce的一个页面上有一个自定义按钮,这个按钮触发一个js代码。
window.open("{!$Label.SF_Base_URL}/apex/DeletePageiFrame",300,300);DeletePageiFrame是一个顶端页面,它有一个iframe(用于外部网站)和一个用于在单击时刷新父窗口的按钮。
<form>
<INPUT TYPE="button" NAME="myButton" onclick="handleOnClose();" value="press to close"/>
</form>
//the js function
function handleOnClose()
{
alert(window.parent.location); // this gives child window location instead
window.parent.location.reload(); //refreshes child not parent
// window.top.location.reload();
// all the functions bellow didnt work.
// window.opener.location.reload(true);
// window.opener.location.reload(false);
// opener.location.reload();
// opener.reload();
// window.opener.location.reload();
// document.opener.document.location.href = document.opener.document.location.href;
}我还试图触发窗口关闭事件来调用父窗口刷新,但我遇到了chrome问题,子窗口被刷新而不是父窗口。
<script> window.onBeforeUnload=handleOnClose();</script>发布于 2012-05-02 03:13:33
这个问题是因为在我的账户上启用了开发模式。如果您启用了它,但您发现发生了一些奇怪的事情,请禁用它,然后重试。现在开发模式有一些问题。
https://stackoverflow.com/questions/10400218
复制相似问题