appcan 跨窗口处理方法 appcan.window.evaluateScript({name,scriptContent,type})使用解读

appcan.window.evaluateScript({

name,/*主窗口名称,此窗口要先用appcan.window.open打开了,才能找到,此方法才会有效*/

scriptContent,/*要运行的function*/

type/*窗口类型,目前为止不知该填些什么东东,可不填*/

})

例:

假如有三个页面 A.html ,  B.html  ,  C.html 等,要从C.html页面触发B.html页的函数 fun(){alert("已运行函数fun()")}


首先打开网址时先进入 A.html,然后从A.html加个click事件,

appcan.window.open({
name:'B',
data:'B.html',
aniId:'2'
})
打开B.html,再从B.html页面

appcan.window.open({
name:'C',
data:'C.html',
aniId:'2'
})
进入C.html页面,我后在 C.html页面使用这个跨窗口方法
加个事件然后触发:
appcan.window.evaluateScript({
name:'B',
scriptContent:'fun()'
})

原文地址:https://www.cnblogs.com/MrZouJian/p/5363948.html