帖子
帖子
用户
博客
课程
显示全部楼层
49
帖子
0
勋章
208
Y币

[其他] api.execScript 报错

[复制链接]
发表于 2018-3-8 14:02:13
if (index == 0) {
        api.execScript({
            frameName: 'main',
            script: 'navdata();'
        });
      }else if (index == 1) {
        api.execScript({
            frameName: 'ninepieces',
            script: 'navdata();'
        });
      }else if (index == 2) {
        api.execScript({
            frameName: 'brand_center',
            script: 'openbrandnav();'
        });
      }






Uncaught ReferenceError: navdata is not defined at JsRuntime : 1

90
帖子
2
勋章
2237
Y币
navdata方法未定义,你没有指定win, 需要这个方法和调用语句在同一个win下面。
49
帖子
0
勋章
208
Y币
angelshelter 发表于 2018-3-8 14:06
navdata方法未定义,你没有指定win, 需要这个方法和调用语句在同一个win下面。 ...

这段是写在 index.html 里面的。
90
帖子
2
勋章
2237
Y币
凡品科技 发表于 2018-3-8 14:09
这段是写在 index.html 里面的。

那你要在main里面定义navdata方法。
49
帖子
0
勋章
208
Y币
angelshelter 发表于 2018-3-8 14:14
那你要在main里面定义navdata方法。

好的 谢啦
34
帖子
5
勋章
2995
Y币
49
帖子
0
勋章
208
Y币
angelshelter 发表于 2018-3-8 14:14
那你要在main里面定义navdata方法。

我 main里面有这个方法
您需要登录后才可以回帖 登录

本版积分规则