简体   繁体   English

JavaScript代码仅在Debugger CRM 2011中有效

[英]JavaScript code working only in Debugger CRM 2011

I have the following line of code to refresh the parent form OnClose of Child form: 我有以下代码行可刷新子窗体的父窗体的OnClose:

var popup = window.open(url, 'New Note', 'width=700,height=700');
 popup.focus();

Problem at below line 下行的问题

 popup.onbeforeunload = RefreshGrid; 

If I attach a breakpoint at above line using Developer Tools in IE-11 then alert is displayed and SomeWork is done: If I remove break-point then alert is not displayed and SomWork in not done. 如果我在IE-11中使用开发人员工具在上述行中附加了一个断点,则显示警报并完成SomeWork:如果我删除断点,则不显示警报且SomWork未完成。

function RefreshGrid() {    
alert("refresh grid");
SomeWork();
}

I have tried alot of different methods but all have the same problem, runs with Break-point and does not run without break-point. 我尝试了很多不同的方法,但是都具有相同的问题,使用断点运行,并且没有断点也无法运行。

Try to bind to onbeforeunload inside the pop up window. 尝试在弹出窗口中绑定到onbeforeunload。 from the onbeforeunload event handler go to opener.RefreshGrid or opener.SomeWork 从onbeforeunload事件处理程序转到opener.RefreshGrid或opener.SomeWork

EDIT: This might be a cross domain issue. 编辑:这可能是跨域问题。 Consider putting the external URL in an IFRAME inside a controllable popup window ie in the same domain of your CRM app. 考虑将外部URL放在可控制的弹出窗口中的IFRAME中,即,在CRM应用程序的同一域中。

If you're browsing with IE you might also consider changing zone security setting for this specific website. 如果使用IE浏览,则可能还会考虑更改此特定网站的区域安全设置。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM