Cordova API设备在Windows Phone 8设备中不起作用

时间:2014-06-07 06:47:07

标签: cordova windows-phone-8

使用此代码

<body onload="LoadDeviceInfo()">
<div data-role="page">
    <div data-role="header" data-position="fixed">
        <h1>Header</h1>
    </div>
    <div data-role="content">
        <p id="deviceInfo">Device Info</p>
        <script>

            function LoadDeviceInfo()
            {
            var element = document.getElementById("deviceInfo");
            element.innerHTML =
                "Device Name : " + device.name + "<br />"
                + "Cordova Version : " + device.cordova + "<br />"
                + "Device Platform : " + device.platform + "<br />"
                + "Device UUID : " + device.uuid + "<br />"
                + "OS Version : " + device.version + "<br />"
                + "Device Model : " + device.model + "<br />";
            }
        </script>
    </div>
    <div data-role="footer" data-position="fixed">
        <h1>Footer</h1>
    </div>
</div>

我在Android设备上构建的结果(华硕Zenfone4) enter image description here

当我在Windows Phone 8(诺基亚lumia620)上构建时的结果 enter image description here

1 个答案:

答案 0 :(得分:0)

自PhoneGap 2.3.0以来,

device.name 已被弃用。如果您使用的是最新版本的PhoneGap(撰写本文时为3.5.0),请改用 device.model