开发者

Cross Domain Scripting - MSCRM 4.0 IFRAME Client-side JavaScript

开发者 https://www.devze.com 2023-01-29 04:16 出处:网络
I have a Microsoft Dynamics CRM 4.0 form with an IFRAME on it that presents a site on a different domain than what CRM is hosted on.

I have a Microsoft Dynamics CRM 4.0 form with an IFRAME on it that presents a site on a different domain than what CRM is hosted on.

What I want to achieve is on the CRM onSave event I want to call a button.click() event on the the IFRAME site so that information gets saved on the CRM form and my IFRAME site form.

Attempts to get the IFRAME site hosted on the same domain within the ISV folder has been tried but the h开发者_如何学Pythonosting partner is not having much luck getting this configured. So I am starting to look for other options.

I have tried the following:

  • Move everything to the same domain (FAIL)
  • Tried the document.domain trick on the IFRAME site. Not sure if I am implementing this the right way.

Does anyone have any other sugestions on how to get the whole inter IFRAME comms thing going in a parent calls child scenario.

Lots out there on child calling out to parent but not really the other way around.


If you only target postMessage capable browsers, use this - if not, use easyXDM which abstracts away all the complexity of cross-domain messaging.

It will let you set up RPC messaging allowing you to do what you seek to do.


window.postMessage should work for you. One more way is to store data in LocalStorage and read it in your iFrame site, also since all major browsers support (including IE) support LocalStorage.

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号