[英]Refreshing parent page refreshes child instead, Salesforce
我在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>
问题是因为我的帐户启用了开发模式。 如果你启用它并且发现一些奇怪的事情,请禁用它并再试一次。 现在开发模式存在一些问题。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.