小编Mna*_*rro的帖子

尝试在iframe中使用Cordova插件

我正在使用Cordova在iframe中加载HTML.一切正常,但我需要访问原始HTML中的插件.
原始代码是这样的

navigator.camera.getPicture(onSuccess, onFail);
Run Code Online (Sandbox Code Playgroud)

当我在iframe中加载HTML时,我需要这样做

parent.navigator.camera.getPicture(onSuccess, onFail);
Run Code Online (Sandbox Code Playgroud)

这段代码工作,但我真的需要不要更改原始代码.有人知道如何在iframe中使用cordova插件吗?

html javascript iframe plugins cordova

13
推荐指数
1
解决办法
2219
查看次数

标签 统计

cordova ×1

html ×1

iframe ×1

javascript ×1

plugins ×1