Opened 12 years ago
Closed 12 years ago
#8216 closed bug (invalid)
Exception in ajaxConvert(s,response)
Reported by: | Owned by: | ||
---|---|---|---|
Priority: | low | Milestone: | 1.next |
Component: | ajax | Version: | 1.5 |
Keywords: | Cc: | ||
Blocked by: | Blocking: |
Description (last modified by )
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":"[email protected]","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":"[email protected]","password":"asdfasdf","orgId":42} **Response Headers** Content-Length:434 Content-Type:application/json;charset=ISO-8859-1 Server:Jetty(7.1.6.v20100715)
Change History (7)
comment:1 Changed 12 years ago by
comment:2 Changed 12 years ago by
Owner: | set to [email protected]… |
---|---|
Status: | new → pending |
As per the bug reporting guidelines, please provide a reduced test case demonstrating this issue.
comment:3 Changed 12 years ago by
Component: | unfiled → ajax |
---|---|
Priority: | undecided → low |
comment:4 Changed 12 years ago by
Description: | modified (diff) |
---|
comment:5 Changed 12 years ago by
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'); } });
comment:6 Changed 12 years ago by
Status: | pending → new |
---|
The text of the exception was: No conversion from 'text' to 'application/json'.
comment:7 Changed 12 years ago by
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).