best method of detecting mobile browsers with javascript/jquery?
<p>For a site I'm working on I'm implementing image preloading with javascript however i most certainly do not want to call my <code>preload_images()</code> function if someone is on slow bandwidth.</p>

<p>For my market the only people with slow bandwidth are those using mobile internet on a smartphone.</p>

<p>What's the best approach for detecting these users so i can avoid image preloading for them?</p>

<hr>

<p>option 1 : detect browser width</p>

<pre><code>if($(window).width() &gt; 960){ preload... }
</code></pre>

<hr>

<p>option 2: detect user-agent with a list of browser to preload for</p>

<pre><code>if($.browser in array safelist){ preload... }
</code></pre>

<hr>

<p>are there any better options?</p>
