0

I am new to cross domain scripting. I have a application with domain abc.com. I am integrating my app. in another website with domain xyz.com using a iframe inside a modal. On clicking a link i will open a modal with a iframe to display my app.Now I need to access iframe parent element i.e., modal and apply events on that modal(while showing and hidding modal) from code inside abc.com . I am unable to access that modal. Can any one help me. Thanks in advance.

user2083041
  • 513
  • 1
  • 8
  • 32

1 Answers1

-1

You can access the Iframe parent from javascript insider the iframe using

parent.abc();

In the Parent you can set the document domain to be the same as the iframe content. This could help preventing cross-domain problems.

<script>
    document.domain = "xyz.com";
</script>
Nikolaj Zander
  • 1,270
  • 9
  • 13