在app中出现致命 错误:api is not defined 这个是什么原因引起的?
产生这样的原因有以下几点:
1、页面非 api.openWin,api.openFrame,api.openFrameGroup 等方法打开的页面然而使用了 api 方法。
2、apiready = function() {} 未初始完成,提前调用了api方法
3、config.xml配置文件中 access 节点 origin 参数值不是 * 或 local
config.xml access节点正确配置:
方式一: <access origin="local" /> 方式二: <access origin="*" /> 方式三: <access origin="local" /> <access origin="https://www.ipwas.cn" />