I get this error: Protocols, domains, and ports must match Iframe has this domain and protocol: http:// www-ec65nhg76pg.mysite.com/ and Parent has this domain and protocol: http:// www.mysite.com/ I have used document.domain='mysite.com' in my web part but it didn't work. Is there any way to solve this problem?

  • Is it Visual Web Part or Content Editor? Can you please share the code snippet... Apr 7, 2016 at 9:28
  • This is Visual Web Part. parent.document.getElementById('#idCF_k33e2697-30cf-e511-80c6-00155d08bb1a'); Apr 7, 2016 at 10:47

1 Answer 1


Is it a regular visual web part inside a WebPartZone? Usually you can access everything rendered in the page without navigating into parent/sibling/child stuff.

You are trying to do it with JS? The WebPart is in another domain and referenced with an Iframe?

  • They don't have the same origion. A web part which has this domain :http:// www-ec65nhg76pg.mysite.com/ & its parent has another doamin: http:// www.mysite.com/ and web part wants to read an element which is outside the iframe(web part). Is it possible to do? Apr 7, 2016 at 14:54
  • That is usually followed by this kind of "cross domain policy" issue. I honestly don't think this can be avoided, because it is probably related to a HTTP/Browser/Security limitation. Apr 7, 2016 at 18:11

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.