H5移动端获取设备id兼容写法
1 let deviceId ="" 2 if (window.plus) { 3 deviceId = plus.device.uuid; 4 } else { 5 // 兼容老版本的plusready事件 6 document.addEventListener( 7 "plusready", 8 function () { 9 deviceId = plus.device.uuid; 10 }, 11 false 12 ); 13 }
1 let deviceId ="" 2 if (window.plus) { 3 deviceId = plus.device.uuid; 4 } else { 5 // 兼容老版本的plusready事件 6 document.addEventListener( 7 "plusready", 8 function () { 9 deviceId = plus.device.uuid; 10 }, 11 false 12 ); 13 }