how to try error in jquery?
<pre><code>   $(document).ready(function(){
 setTimeout(function() { 
        window.location.href = $(".user a")[0].href; 
     }, 2000);
});
</code></pre>

<p>i put the above jquery code in a js file.which invoked by the site's header template.but in some pages(there is no <code>.user a</code>) shows an error "<code>0.href is null or not an object</code> on IE status bar. how to prevent the error shows.</p>
