<?xml version="1.0" encoding="utf-8" standalone="yes"?><rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom"><channel><title>Mobile on David Hamp-Gonsalves</title><link>https://davidhampgonsalves.com/tags/mobile/</link><description>Recent content in Mobile on David Hamp-Gonsalves</description><generator>Hugo -- gohugo.io</generator><language>en-US</language><lastBuildDate>Mon, 21 Oct 2013 00:00:00 +0000</lastBuildDate><atom:link href="https://davidhampgonsalves.com/tags/mobile/index.xml" rel="self" type="application/rss+xml"/><item><title>Detecting Mobile Device from Javascript</title><link>https://davidhampgonsalves.com/detecting-mobile-device-from-javascript/</link><pubDate>Mon, 21 Oct 2013 00:00:00 +0000</pubDate><guid>https://davidhampgonsalves.com/detecting-mobile-device-from-javascript/</guid><description>This is a pretty lightweight way of detecting when your javascript is living in a mobile device.
if(typeof window.orientation != &amp;#39;undefined&amp;#39;) { /* put mobile spesific code here */ } To omit spesific devices from running this code you can also add individual checks like the following.
if(typeof window.orientation != &amp;#39;undefined&amp;#39; &amp;amp;&amp;amp; !navigator.userAgent.match(/iPad/i)) { /* put mobile spesific(but not ipad) code here */ } This is a mix of the answers found on stack overflow.</description></item></channel></rss>