Possible duplicate:
jquery doesn't call success method on $ .ajax for rails standard REST DELETE answer
I respond to the remote link (data-remote = "true" data-type = "json") and outputs
format.json { head :ok }
in my Rails controller (3.2.6), which creates this header:
Status Code:200 OK
... Connection:keep-alive Content-Length:1 Content-Type:application/json; charset=utf-8 Server:thin 1.4.1 codename Chromeo Set-Cookie: ... path=/; HttpOnly X-UA-Compatible:IE=Edge ...
In my JavaScript file , ajax: complete is run and 200 (data.status) is output.
$( '#myElement' ).on( 'ajax:complete', function( e, data ) { console.log( data.status ); });
The data is as follows:
... readyState: 4 responseText: " " setRequestHeader: function ( name, value ) {... state: function () {... status: 200 statusCode: function ( map ) {... statusText: "OK" ...
Looks good to me ...
Problem
Instead of ajax: success jQuery (jquery-ujs) executes ajax: error , and I have no idea why, because the error is not indicated.
I thought a lot about the discussions, but in this way it always seemed like a solution, not a problem. Thanks for any help!
jquery ruby-on-rails-3
Railsana Sep 13 '12 at 13:23 2012-09-13 13:23
source share