0

I have a code (HTML pages with javascript and css)that can be used from web browser or mobile device .

In case the page is accessed from mobile/tablet i need to load phonegap's corodava js

jQuery(document).ready(function($){

$('head').append('<script type="text/javascript" src="cordava.js"></script>');

});

My question is how can i know if a page is accessed from browser or a Mobile device /tablet??

  • You could use [modernizr](http://modernizr.com/) to check if the device is touch enabled, there are also plugins for [checking platform](https://www.npmjs.org/package/mobile-detect) – Brett Gregson Mar 10 '15 at 10:39
  • what will you do with cordova.js if it is accessed via web – Naeem Shaikh Mar 10 '15 at 10:40

0 Answers0