<!DOCTYPE html> <html> <head> <meta charset=UTF-8> <title>My Device</title> <script type=text/javascript charset=UTF-8 src=cordova.js></script> <script type=text/javascript charset=UTF-8> function onLoad() { document.addEventListener(deviceready, onDeviceReady, false); } function onDeviceReady() { var myDiv = document.getElementById('props'); myDiv.innerHTML = 'Device Name: ' + device.name + '<br />' + 'Device PhoneGap: ' + device.phonegap + '<br />' + 'Device Platform: ' + device.platform + '<br />' + 'Device UUID: ' + device.uuid + '<br />' + 'Device Version: ' + device.version + '<br />' } </script> </head> <body onload=onLoad()> <p id=props> Loading device properties...</p> </body> </html>
以上这篇使用phonegap获取设备的一些信息方法就是小编分享给大家的全部内容了,希望能给大家一个参考,也希望大家多多支持VeVb武林网。