我正在尝试为我的网站设置一个视频聊天工具,我想知道是否可以在window.open上存储URL,因为在特定的URL链接打开后,它创建一个指定环聊的唯一URL。我想将该唯一的环聊URL存储到var中,当检测到移动设备时,它会打开该唯一URL而不是主链接。
handler : function(b, e) {
if (/Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(navigator.userAgent)) {
window.open('pathname' || 'x');
} else {
window.open('https://hangoutsapi.talkgadget.google.com/hangouts?gid=10820338402');
var pathname = window.open.location.pathname;
var x = $(location).attr('<href>');
console.log(pathname);
console.log(x);
}
}