Bug Tracker

Opened 10 years ago

Closed 10 years ago

#13996 closed bug (notabug)

jQuery.ajax: doesn't emit complete event for jsonp requests

Reported by: me@… Owned by:
Priority: undecided Milestone: None
Component: unfiled Version: 1.10.1
Keywords: Cc:
Blocked by: Blocking:

Description

When attempting an AJAX request with a dataType of 'jsonp', the complete event/callback never get ran. If this is intentional (which it shouldn't be -- how else am I supposed to handle jsonp AJAX errors?) it's not mentioned in the jQuery documentation.

Reproducable:

$.ajax({
	dataType: 'jsonp',
	url: 'http://shopify.pyrokinetiq.com/credit/fetchCustomer/1',
	complete: function(xhr, status){
		console.log(status);
	}
});

Expected same result as:

$.ajax({
	url: 'http://shopify.pyrokinetiq.com/credit/fetchCustomer/1',
	complete: function(xhr, status){
		console.log(status);
	}
});

Change History (1)

comment:1 Changed 10 years ago by dmethvin

Resolution: notabug
Status: newclosed

Your URL http://shopify.pyrokinetiq.com/credit/fetchCustomer/1 is sending JSON and not JSONP. Ask about how you can put the P in your JSON (and why we cannot just P for you) on forum.jquery.com or StackOverflow.

Note: See TracTickets for help on using tickets.