I developed a web part that is loading a dialog, something like:

var dialog = SP.UI.$create_DialogOptions();
dialog.url = '_layouts/page.aspx';


Inside this dialog I have several stuff and what I want to do is to load an iframe and that iframe should access the javascript code from its parent. When I try to do this:


it complains about cross domain issues. How can I solve this? I'm using SharePoint 2010

  • What version of SharePoint are you using?
    – lwbecker2
    Mar 10, 2014 at 14:17
  • sharepoint 2010
    – nhenrique
    Mar 10, 2014 at 14:24

3 Answers 3


For Silverlight Client Side Object Model applications you need to configure some cross domain access policies via one or more XML files.

CrossDomain.xml and ClientAccessPolicy.xml are the files that control this for client-side object model access in SharePoint 2010 with SilverLight. There may be simliar configuration steps that are needed for ECMAScript / JavaScript to work.


Sounds like you want to do cross-window messaging via postMessage. Plenty of tutorials on the web, here's one I've found from a quick Google: http://javascript.info/tutorial/cross-window-messaging-with-postmessage


To access the script in iframe page (from different domain), you need to use javascript postmessage function, since direct script communication is not allowed when the domains of iframe and parent pages differs. Please refer this link for further details.


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.