views:

62

answers:

1

After some research (even at stackoverflow) I still can't figure out how to do this. parent.method() won't do the trick, nor some other solutions I've tried.

Situation: I have a index.html on the client side (mobile phone in this case) which has an iframe loading server-side page. What I need to do is call a javascript method defined in the index.html (client side) from the iframe content (server-side).

As an example (I'm not using android in the question described above), Android apps have addJavascriptInterface which, when defined, allows one to call methods defined client-side from server-side pages just invoking window.CustomObject.MethodToCall().

Any hint?

Thanks!

A: 
window.top.foo 

for the top level window

window.parent.foo

for the direct parent

Ollie Edwards
These don't work as well. Please check my comment above!
GuilhermeA