Skip to main content

Bug Tracker

Side navigation

#11491 closed bug (duplicate)

Opened March 20, 2012 01:37PM UTC

Closed March 20, 2012 02:13PM UTC

Last modified March 21, 2012 10:43AM UTC

$.post() requires a value back

Reported by: eldmannen+jquery@gmail.com Owned by:
Priority: undecided Milestone: None
Component: unfiled Version: 1.7.1
Keywords: Cc:
Blocked by: Blocking:
Description

$.post("/Foo", { id: "2" });

This will make Firefox state "no element found".

If on the server side there is:

[HttpPost]
public void Foo(int id)
{
    // Nothing
}

However, if I switch the 'void' to 'bool' and return true, then it works:

[HttpPost]
public bool Foo(int id)
{
    return true;
}

Now Firefox does not say "no element found" anymore.

It seems that jQuery requires/expects a value to be returned by the server for the POST request.

However, the server already returns HTTP 200 OK which should be enough.

Attachments (0)
Change History (3)

Changed March 20, 2012 02:13PM UTC by rwaldron comment:1

resolution: → duplicate
status: newclosed

Changed March 20, 2012 02:13PM UTC by rwaldron comment:2

Duplicate of #11489.

Changed March 21, 2012 10:43AM UTC by anonymous comment:3

It is not possible to reproduce this with the echo service provided by jsfiddle because of limitations in jsfiddle. Namely it always returns a Content-Type header.

The bug occurs when the response does not contain a Content-Type header.