iframe parent.function() call is undefined when used in Phonegap
Hello everyone and thanks in advance for help. Here is my situation:
I have Phonegap 0.9.5 setup and I am making an application in Eclipse. I have everything setup fine and in my app assets/www/index.html of my Phonegap application:
<iframe id='downloader' frameborder='0' style='width:100%' src='http://www.myste.com/mobile/index.html'></iframe>
http://www.myste.com/mobile/index.html has this button:
<input style="position:relative;top:200px;z-index:5;" type="button" onclick="alert(parent.location.href)" value="DOES MOM EXIST?" />';
But for some reason, I 开发者_高级运维am returned an "undefined". My ultimate goal is to have the button in the iframe call a function in the parent (assets/www/index.html):
onclick="parent.somefunction();"
Can anyone help me out here?
Should be something like window.top.location.href
?
精彩评论