title: $.ajax not working first time
body: <p>I have a button in html page.</p>
  
  <pre><code>&lt;input type="image" src="images/login_button.png" id="imageButton" onclick="LoginButtonClick();" /&gt;
  </code></pre>
  
  <p>I am calling this method on button click:</p>
  
  <pre><code>LoginButtonClick = function() {
      alert ("Button click event raised");  // this alert msg raising every time when onclick event occurs.
      $.ajax({  
          alert ("Inside Ajax.");  // This alert not executing first 1 or 2 times.
          type: 'GET',
          url: 'http://URL/Service.svc/LoginValidation',
          dataType: 'json',
          error: pmamml.ajaxError,
          success: function(response, status, xhr) {
              if (response != "") {
                  alert ("Response receive ");
                  }
              else {
                  alert("Invalid Data.");
              }
          }
      });
  }
  </code></pre>
  
  <p>As I mentioned above <code>$.ajax</code> not working first 2 , 3 button click attempts.</p>
  
  <p>In mozilla it throws an error "[Exception... "Component returned failure code: 0x80004005 (NS_ERROR_FAILURE)"  nsresult: "0x80004005 (NS_ERROR_FAILURE)"  location: "JS frame :: JQuery.js ::  :: line 20"  data: no]"</p>
  
  <p>Is there any way to fix this issues..</p>