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

cweiske
  • 28,704
  • 13
  • 124
  • 186
madhur
  • 317
  • 2
  • 6
  • 16
  • 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. – Ravi Gadag Mar 08 '13 at 06:39
  • 2
    is the iframe source from the same domain or different one – Arun P Johny Mar 08 '13 at 06:39
  • There is also `Same Origin Policy` to consider http://stackoverflow.com/questions/9700766/iframe-call-parent-function – Arun P Johny Mar 08 '13 at 06: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 – Arun P Johny Mar 08 '13 at 06:42

2 Answers2

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

Community
  • 1
  • 1
Arun P Johny
  • 376,738
  • 64
  • 519
  • 520
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

Community
  • 1
  • 1
lngs
  • 671
  • 1
  • 7
  • 17