终于弄明白这问题了,只要在js文件里加上段代码,就可解决两窗口间通信问题。 var str = { username: User.name, userrole: User.role };// var new_win = Task.openWin(‘home.html‘); var new_win = gui.Window.get(window.open(‘home.html‘, {focus: true}) ); new_win.on(‘loaded‘, function (User) { new_win.window.window.str = str; new_win.window.window.document.getElementById(‘msg‘).innerHTML="登录成功,用户名:" + str.username + ",用户角色:" +str.userrole; });
时间: 2024-12-30 04:12:13