首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >刷新父页面会刷新子页面,Salesforce

问刷新父页面会刷新子页面,Salesforce
EN

Stack Overflow用户
提问于 2012-05-01 23:44:55
回答 1查看 3.7K关注 0票数 0

我在salesforce的一个页面上有一个自定义按钮,这个按钮触发一个js代码。

代码语言:javascript
复制
 window.open("{!$Label.SF_Base_URL}/apex/DeletePageiFrame",300,300);

DeletePageiFrame是一个顶端页面,它有一个iframe(用于外部网站)和一个用于在单击时刷新父窗口的按钮。

代码语言:javascript
复制
<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问题,子窗口被刷新而不是父窗口。

代码语言:javascript
复制
<script> window.onBeforeUnload=handleOnClose();</script>
EN

回答 1

Stack Overflow用户

回答已采纳

发布于 2012-05-02 03:13:33

这个问题是因为在我的账户上启用了开发模式。如果您启用了它,但您发现发生了一些奇怪的事情,请禁用它,然后重试。现在开发模式有一些问题。

票数 2
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/10400218

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档