cordova plugin add device
cordova plugin add device 运行命令也没有出错然后在html里这么写
document.addEventListener('deviceready',onDeviceReady(), false);
function onDeviceReady(){
try{
alert(device.cordova);
}catch(e){
alert(e);
}
}
但是出错device is not defined
求解
得模拟器或者手机上运行,浏览器没法运行的
还有需要安装这个插件
cordova plugin add cordova-plugin-device
https://www.npmjs.com/package/cordova-plugin-device
页:
[1]