<!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武林網。