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.
Asked
Active
Viewed 353 times
1 Answers
-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
-
You can only set `document.domain` to a superdomain of the current domain, which that isn't. – Quentin Mar 15 '16 at 10:38