Bug Tracker

Ticket #8216 (closed bug: invalid)

Opened 4 years ago

Last modified 4 years ago

Exception in ajaxConvert(s,response)

Reported by: jon@… Owned by: jon@…
Priority: low Milestone: 1.next
Component: ajax Version: 1.5
Keywords: Cc:
Blocking: Blocked by:

Description (last modified by jitter) (diff)

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)

Change History

comment:1 Changed 4 years ago by jaubourg

The text of the exception and the actual ajax call would help (rather than the line throwing it).

comment:2 Changed 4 years ago by snover

  • Owner set to jon@…
  • Status changed from new to pending

As per the bug reporting guidelines, please provide a reduced test case demonstrating this issue.

comment:3 Changed 4 years ago by jitter

  • Priority changed from undecided to low
  • Component changed from unfiled to ajax

comment:4 Changed 4 years ago by jitter

  • Description modified (diff)

comment:5 Changed 4 years ago by anonymous

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 4 years ago by jon@…

  • Status changed from pending to new

The text of the exception was: No conversion from 'text' to 'application/json'.

comment:7 Changed 4 years ago by snover

  • Status changed from new to closed
  • Resolution set to invalid

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.

Note: See TracTickets for help on using tickets.