title: jQuery AJAX producing 304 responses when it shouldn't
body: <p>This really has me scratching my head. Namely because it only happens in IE, not Firefox, and I was under the impression that jQuery was effectively browser neutral. I've been cracking at this thing for the past few hours and have nailed down, at least, what is happening.</p>
  
  <p>This jqGrid:</p>
  
  <pre><code>$("#DocumentListByPartRecordsGrid").jqGrid(
            {
              datatype: 'local',            
              colNames: ['&lt;b&gt;Id&lt;/b&gt;', '&lt;b&gt;Document Name&lt;/b&gt;', '&lt;b&gt;Document Type&lt;/b&gt;', '&lt;b&gt;Effective Date&lt;/b&gt;', '&lt;b&gt;Expiration Date&lt;/b&gt;', '&lt;b&gt;Delete&lt;/b&gt;'],
              colModel: [
                    { name: 'ASSOCIATION_ID', Index: 'ASSOCIATION_ID', resizable: true, align: 'left', hidden: true, sortable: false },
                    { name: 'FILE_NAME', Index: 'FILE_NAME', resizable: true, align: 'left', sortable: false, width:'20%' },
                    { name: 'DOCUMENT_TYPE', Index: 'DOCUMENT_TYPE', resizable: true, align: 'left', sortable: false, width:'20%' },
                    { name: 'EFFECTIVE_DATE', Index: 'EFFECTIVE_DATE', resizable: true, align: 'left', sortable: false, width:'20%' },
                    { name: 'EXPIRATION_DATE', Index: 'EXPIRATION_DATE', resizable: true, align: 'left', sortable: false, width:'20%' },
                    { name: 'Delete', Index: 'Delete',resizable: true, align: 'center', sortable: false, width:'20%' },
                    ],            
              rowNum: 15,
              rowList: [15, 50, 100],
              imgpath: '/Drm/Content/jqGrid/steel/images',
              viewrecords: true,            
              height: 162,           
              loadui: 'block',
              forceFit: true
          });
  </code></pre>
  
  <p>Filled by this function:</p>
  
  <pre><code>var mydata = '';    
  &lt;% if(!string.IsNullOrEmpty(Model.PCAssociatedDocuments)) { %&gt;        
     var mydata = &lt;%= Model.PCAssociatedDocuments %&gt;;
  &lt;% } %&gt;
  
  for (var i = 0; i &lt;= mydata.length; i++){
          jQuery("#DocumentListByPartRecordsGrid").addRowData(i, mydata[i], "last");
          }
  </code></pre>
  
  <p>Which is cleanly populated from the model. This is not the issue. The issue arises when using the delete functionality, which is formatted back in the controller like so:</p>
  
  <pre><code>&lt;a class='deleteAttachment' style='cursor: pointer;' href='#' onclick='javascript:PCDocumentDelete(" + s.AssociationId.ToString() + ", " + pcId + ");'&gt;Delete&lt;/a&gt;
  </code></pre>
  
  <p>and calls this function</p>
  
  <pre><code>function PCDocumentDelete(id, pcid) {
  if (confirm("Are you sure you want to delete this document?")) {
      $.blockUI({
          message: "Working...",
          css: {
              background: '#e7f2f7',
              padding: 10
          }
      });
      $.ajax(
          {
              url: '/DRM/Pc/DeleteAssociation?associationId=' + id + '&amp;pcid=' + pcid,
              async: true,
              dataType: "json",
              success: function(result) {
                  if (result.Success == true) {
                      //Reload grid                       
                      $.ajax({ async: false });
                      $("#DocumentListByPartRecordsGrid").setGridParam({ url: "/Drm/Pc/DeAssociatePartRecordsWithDocument?pcid=" + pcid, datatype: 'json', myType: 'GET', page: 1 });
                      $("#DocumentListByPartRecordsGrid").trigger("reloadGrid");
                      $.unblockUI();
                      $.showGlobalMessage('Specified document has been successfully disassociated from this part record.');
                  }
                  else {
                      $.unblockUI();
                      $.showGlobalMessage('An error occurred deleting the attachment.');
                  }
              },
              error: function(res, stat) {
                  alert(res.toString());
                  alert(stat.toString());
              }
          });
      return false;
  }
  else {
      return false;
  }
  </code></pre>
  
  <p>}</p>
  
  <p>(showGlobalMessage is an internal function that creates a particularly formatted blockUI)</p>
  
  <p>The ajax calls a method back in the controller, but the issue arises before we make it that far, so unless someone thinks it important, I'm not going to post that code. What happens is, often for inexplicable reasons, the first burst of ajax that calls PC/DeleteAssociation is coming back with a 304 (not modified) response. I know that happens on a get when nothing has changed that needs to be refreshed. But this isn't a get, it should be treated as a post, and I was under the impression that jquery.ajax was designed to, unless otherwise instructed, not generate 304 responses. I'm obviously missing something here and have been staring at it far too long to catch it myself. Anyone see what I missed? Thank you.</p>