javascript - iOS iPad and iPhone user agent does not work in Phonegap application -
i´m trying detect if device ipad or iphone, isn´t working emulator. works if test in safari browser on ipad. there difference? uses "else" iphone..
this code:
var isipad = navigator.useragent.match(/ipad/i) != null; $(document).ready(function(){ if(isipad) { window.location.replace("tab/indextabstart.html"); } else { window.location.replace("smart/indexsmartstart.html"); } }); please me thanks!
you can try api provided phonegap. try using device.model
device.model - device's model name.
example:
var string = device.model;
description
the device.model returns name of device's model or product. value set device manufacturer , may different across versions of same product.
for full documentation here:
http://docs.phonegap.com/en/3.0.0/cordova_device_device.md.html#device
Comments
Post a Comment