Side navigation
#8216 closed bug (invalid)
Opened February 09, 2011 12:08AM UTC
Closed February 10, 2011 09:16PM UTC
Exception in ajaxConvert(s,response)
| Reported by: | jon@code42.com | Owned by: | jon@code42.com |
|---|---|---|---|
| Priority: | low | Milestone: | 1.next |
| Component: | ajax | Version: | 1.5 |
| Keywords: | Cc: | ||
| Blocked by: | Blocking: |
Description
I am quite sure this is a bug because it works fine using version 1.4. I hope I've provided enough info. Can't think of what else would help.
This is the line that throws the error (line 6878 or so):
jQuery.error( "No conversion from " + conversion.replace(" "," to ") );
The value of the "response" variable is:
{"firstName":"asdf","lastName":"asdf","username":"asdffdas@acme.com","password":"asdfasdf","orgId":42}
The request as reported by Chrome looks like this:
Request URL:http://localhost:4280/api/User
Request Method:POST
Status Code:200 OK
**Request Headers**
Accept-Charset:ISO-8859-1,utf-8;q=0.7,*;q=0.3
Accept-Encoding:gzip,deflate,sdch
Accept-Language:en-US,en;q=0.8
Connection:keep-alive
Content-Length:102
Cookie:compId=1ln9y0mk97g401mifxnnionvkt; JSESSIONID=v1obq3yiyfe91lujxsm37sd31; c42_cookie_token=263pn463xn1w7k75rhuo9ppg
Host:localhost:4280
Origin:http://localhost:4280
Referer:http://localhost:4280/admin/app.html
User-Agent:Mozilla/5.0 (Macintosh; U; Intel Mac OS X 10_6_6; en-US) AppleWebKit/534.13 (KHTML, like Gecko) Chrome/9.0.597.84 Safari/534.13
accept:*/*
authorization:TOKEN 263pn463xn1w7k75rhuo9ppg-jkzcnjhcg6io75h69ysk8mi0
authorization-challenge:false
content-type:application/json
x-requested-with:XMLHttpRequest
**Request Payload**
{"firstName":"asdf","lastName":"asdf","username":"asdffdas@acme.com","password":"asdfasdf","orgId":42}
**Response Headers**
Content-Length:434
Content-Type:application/json;charset=ISO-8859-1
Server:Jetty(7.1.6.v20100715)
Attachments (0)
Change History (7)
Changed February 09, 2011 12:56AM UTC by comment:1
Changed February 09, 2011 02:56AM UTC by comment:2
| owner: | → jon@code42.com |
|---|---|
| status: | new → pending |
As per the bug reporting guidelines, please provide a reduced test case demonstrating this issue.
Changed February 09, 2011 07:57AM UTC by comment:3
| component: | unfiled → ajax |
|---|---|
| priority: | undecided → low |
Changed February 10, 2011 07:37PM UTC by comment:4
| description: | I am quite sure this is a bug because it works fine using version 1.4. I hope I've provided enough info. Can't think of what else would help. \ \ This is the line that throws the error (line 6878 or so): \ jQuery.error( "No conversion from " + conversion.replace(" "," to ") ); \ \ The value of the "response" variable is: \ {"firstName":"asdf","lastName":"asdf","username":"asdffdas@acme.com","password":"asdfasdf","orgId":42} \ \ The request as reported by Chrome looks like this: \ \ Request URL:http://localhost:4280/api/User \ Request Method:POST \ Status Code:200 OK \ **Request Headers** \ Accept-Charset:ISO-8859-1,utf-8;q=0.7,*;q=0.3 \ Accept-Encoding:gzip,deflate,sdch \ Accept-Language:en-US,en;q=0.8 \ Connection:keep-alive \ Content-Length:102 \ Cookie:compId=1ln9y0mk97g401mifxnnionvkt; JSESSIONID=v1obq3yiyfe91lujxsm37sd31; c42_cookie_token=263pn463xn1w7k75rhuo9ppg \ Host:localhost:4280 \ Origin:http://localhost:4280 \ Referer:http://localhost:4280/admin/app.html \ User-Agent:Mozilla/5.0 (Macintosh; U; Intel Mac OS X 10_6_6; en-US) AppleWebKit/534.13 (KHTML, like Gecko) Chrome/9.0.597.84 Safari/534.13 \ accept:*/* \ authorization:TOKEN 263pn463xn1w7k75rhuo9ppg-jkzcnjhcg6io75h69ysk8mi0 \ authorization-challenge:false \ content-type:application/json \ x-requested-with:XMLHttpRequest \ **Request Payload** \ {"firstName":"asdf","lastName":"asdf","username":"asdffdas@acme.com","password":"asdfasdf","orgId":42} \ **Response Headers** \ Content-Length:434 \ Content-Type:application/json;charset=ISO-8859-1 \ Server:Jetty(7.1.6.v20100715) \ → I am quite sure this is a bug because it works fine using version 1.4. I hope I've provided enough info. Can't think of what else would help. \ \ This is the line that throws the error (line 6878 or so): \ `jQuery.error( "No conversion from " + conversion.replace(" "," to ") );` \ \ The value of the "response" variable is: \ `{"firstName":"asdf","lastName":"asdf","username":"asdffdas@acme.com","password":"asdfasdf","orgId":42}` \ \ The request as reported by Chrome looks like this: \ {{{ \ Request URL:http://localhost:4280/api/User \ Request Method:POST \ Status Code:200 OK \ **Request Headers** \ Accept-Charset:ISO-8859-1,utf-8;q=0.7,*;q=0.3 \ Accept-Encoding:gzip,deflate,sdch \ Accept-Language:en-US,en;q=0.8 \ Connection:keep-alive \ Content-Length:102 \ Cookie:compId=1ln9y0mk97g401mifxnnionvkt; JSESSIONID=v1obq3yiyfe91lujxsm37sd31; c42_cookie_token=263pn463xn1w7k75rhuo9ppg \ Host:localhost:4280 \ Origin:http://localhost:4280 \ Referer:http://localhost:4280/admin/app.html \ User-Agent:Mozilla/5.0 (Macintosh; U; Intel Mac OS X 10_6_6; en-US) AppleWebKit/534.13 (KHTML, like Gecko) Chrome/9.0.597.84 Safari/534.13 \ accept:*/* \ authorization:TOKEN 263pn463xn1w7k75rhuo9ppg-jkzcnjhcg6io75h69ysk8mi0 \ authorization-challenge:false \ content-type:application/json \ x-requested-with:XMLHttpRequest \ **Request Payload** \ {"firstName":"asdf","lastName":"asdf","username":"asdffdas@acme.com","password":"asdfasdf","orgId":42} \ **Response Headers** \ Content-Length:434 \ Content-Type:application/json;charset=ISO-8859-1 \ Server:Jetty(7.1.6.v20100715) \ }}} |
|---|
Changed February 10, 2011 08:06PM UTC by comment:5
Here is the ajax request:
$.ajax({
type:'POST',
url:'/api/User',
data:$.toJSON(user),
contentType:'application/json',
dataType:'application/json',
success: function(data) {
alert('success');
},
error: function(xhr, textStatus) {
alert('error');
}
});
Changed February 10, 2011 08:11PM UTC by comment:6
| status: | pending → new |
|---|
The text of the exception was: No conversion from 'text' to 'application/json'.
Changed February 10, 2011 09:16PM UTC by comment:7
| resolution: | → invalid |
|---|---|
| status: | new → closed |
Thanks for the report, but this is not a jQuery bug. application/json is not a valid value for the dataType property. Please read the documentation. In the future, please use the jQuery Forum for support requests.
The text of the exception and the actual ajax call would help (rather than the line throwing it).