1

I want to call a javascript function of parent page where iframe is placed. from the page inside an iframe.

i have tried parent.function_in_parent(); its not working

yes both are in same domain.

for example: there are 5 .net pages page1.aspx,page2.aspx,page3.aspx,page4.aspx,page5.aspx and master.aspx

master.aspx contains the iframe with source page1.aspx, i want to call function abc() written in master.aspx from page1.aspx

4
  • please post your code. before asking question, do some home work and give as much good information on the problem. so that everbody can understand it. Commented Mar 8, 2013 at 6:39
  • 2
    is the iframe source from the same domain or different one Commented Mar 8, 2013 at 6:39
  • There is also Same Origin Policy to consider stackoverflow.com/questions/9700766/iframe-call-parent-function Commented Mar 8, 2013 at 6:40
  • If short, if both the parent and child are from same origin then it should be possible, else Same Origin Policy will prevent it Commented Mar 8, 2013 at 6:42

2 Answers 2

1

In short, if both the parent and child are from same origin then it should be possible, else Same Origin Policy will prevent it

Sign up to request clarification or add additional context in comments.

Comments

0

Check this

Calling a parent window function from an iframe

If your iframe has the different domain to the parent, your work will be a lot more harder. You'll need to see easyXDM

Comments

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.