title: Getting "prompt aborted by user" javascript exception
body: <p>I am getting <strong>"Components.Exception("prompt aborted by user", Cr.NS_ERROR_NOT_AVAILABLE)"</strong>  exception when I am using "windows.location.href" in javasacript. My Code is: </p>
  
  <pre><code>function checkCookie(){
  var value = null;   
  var cookieName='UserDetailsCookie'; 
  value=ReadCookie(cookieName);   
  if(value != null){          
      var url='&lt;%=request.getContextPath()%&gt;/jsp/admin.jsp';
      window.location.href = url;     
  }
  document.loginForm.userName.focus();
  </code></pre>
  
  <p>} </p>
  
  <pre><code>function ReadCookie(name)
  {
    name += '=';
    var parts = document.cookie.split(/;\s*/);
    for (var i = 0; i &lt; parts.length; i++)
    {
      var part = parts[i];
      if (part.indexOf(name) == 0)
            return part.substring(name.length);
        }
    return null;
  </code></pre>
  
  <p>}</p>
  
  <p>and I am calling this method on onLoad event of body</p>
  
  <pre><code>&lt;body onLoad="javascript:checkCookie();"&gt;
  </code></pre>
  
  <p>In anyone knows why this exception throws please?</p>