Hi Alex -
Yes, in JS you can check if cordova object is available something like this:
pre
code
if (typeof cordova == "undefined") {
//it's html5
} else {
//it's hybrid
}/code
/pre
Hi Alex -
Yes, in JS you can check if cordova object is available something like this:
pre
code
if (typeof cordova == "undefined") {
//it's html5
} else {
//it's hybrid
}/code
/pre
Hi Illya,
Maybe I didnt explain well...
I just need some code to check if the html5 page run on a mobile device, or a desktop browser, in order to switch design and make it responsive....nothing to do with a hybrid app..
I found this link, but not truly understand...
http://stackoverflow.com/questions/80...
Can you help me with that?
Regards
Hi Alex,
You can use following JS code on "page show" event handler :
pre
if (navigator.userAgent.match(/(iPhone|iPod|iPad|Android|BlackBerry|IEMobile)/)) {
//here is code if browser in mobile device
alert("mobile");
} else {
//here is code if browser is desctop.
alert("desctop");
};
/pre
Regards.