开发者

iframe parent.function() call is undefined when used in Phonegap

开发者 https://www.devze.com 2023-03-08 15:08 出处:网络
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 appassets/www/index.

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?

0

精彩评论

暂无评论...
验证码 换一张
取 消