I have two scripts and stylesheet, one is for mobile device and another for pc.
I don't want to load the CSS stylesheet and JS file when user access from mobile or tablet devices
<script type="text/javascript">
var ismobile = (/iphone|ipad|ipod|android|blackberry|mini|windows\sce|palm/i.test(navigator.userAgent.toLowerCase()));
if(!ismobile) document.write('<script src="js/PCDemo.js"></script>');
if(!ismobile) document.write('<link href="css/PCDemo.css" rel="stylesheet" />');
if(ismobile) document.write('<script src="js/MobileDemo.js"></script>');
if(ismobile) document.write('<link href="css/MobileDemo.css" rel="stylesheet" />');
</script>
I found this stackoverflow link
Is it good way to load the file?..