Skip to main content

Bug Tracker

Side navigation

#12011 closed bug (invalid)

Opened July 04, 2012 02:44PM UTC

Closed July 12, 2012 01:45AM UTC

Last modified July 12, 2012 01:50AM UTC

HEAD only response caused JQUERY parser fail

Reported by: hayafirst@gmail.com Owned by:
Priority: undecided Milestone: None
Component: unfiled Version: 1.7.2
Keywords: Cc:
Blocked by: Blocking:
Description

When I return a HEAD 200 to a Jquery ajax call. I got: JSON Parse error: Unexpected EOF. The whole error looks like this:

[[Image(http://i.imgur.com/xTYaT.png)]]

pass back an empty JSON then it is OK

my ajax call looks like this:

$(function(){
  $("#login-form").submit(function(){
    var form_values = $(this).serializeArray();
    $.ajax({
      url: "/login.json",
      type: "post",
      data: form_values,
      success: function(){
        window.location.href = "/";
      },

      error: function(jqXHR, textStatus, errorThrown){
        console.log(textStatus);
        console.log(jqXHR);
        console.log(errorThrown);
      }
    }
    );
    return false;
  })
}
);

Attachments (0)
Change History (2)

Changed July 12, 2012 01:45AM UTC by dmethvin comment:1

resolution: → invalid
status: newclosed

Yeah, don't pass back nothing if the request is expecting something.

Changed July 12, 2012 01:50AM UTC by anonymous comment:2

The point is the request is not really expecting something. The user script can handle empty json case, just query can't.