问题描述
点击A页面,需要改变B页面中的一个js变量值
问题解决
A页面中
var target = plus.webview.getWebviewById('data.html');
target.evalJS("changeType('" + id + "')");
B页面中
//供experiment页面调用的函数——改变type的值,并且获取数据
function changeType(typeFromExp) {
type = typeFromExp;
mui.getJSON(
//-------------进入界面获取点击相应侧滑菜单按钮中的值-----//
'http://111.61.221.91:808/index.php/history/' + type,
function(res) {
data = [];
createChart(res);
statistics();
}
)
}