1***@qq.com
1***@qq.com
  • 发布:2017-12-01 11:21
  • 更新:2017-12-01 11:26
  • 阅读:1090

A页面创建webviewB,B里面调用A的方法

分类:MUI

A页面方法:

function openUrl(tourl) {
var st = plus.webview.create(tourl, "h_study", {
softinputMode: 'adjustPan'
});
st.show();
}

function aaa(){
alert(111);
}

openUrl('http://sssssssss.ssssss.sss');

B页面想调用A页面的aaa方法

2017-12-01 11:21 负责人:无 分享
已邀请:
回梦無痕

回梦無痕 - 暂停服务

A页面:

function aaa(id)  
{  
    alert(id);  
}  
window.addEventListener('trigger_aaa',function(event){  
    var id = event.detail.id;  
    aaa(id);  
});

B页面:

PageA = plus.webview.getWebviewById('A页面');  
mui.fire(APageA ,'trigger_aaa',{  
    id:id  
});

该问题目前已经被锁定, 无法添加新回复