jquery doesn't call success method on $.ajax for rails standard REST DELETE answer

前端 未结 3 1236
青春惊慌失措
青春惊慌失措 2020-12-07 22:06

May be such problem is not new, but I didn\'t find anything similar. I have such jQuery code:

$.ajax({ 
  url : (\'/people/\'+id), 
  type : \'DELETE\', 
           


        
3条回答
  •  南笙
    南笙 (楼主)
    2020-12-07 22:40

    This is sometimes caused by an old version of the jQuery Validate Plugin. If you are using this plugin, this sometimes leads to this issue. There is an update that fixes this, if it applies to your case.

    Alternatively, you can probably figure out what's going wrong by setting up an error handler via:

    $.ajaxSetup() or $.ajaxError()

    This will probably return a parse error. The newer versions of jQuery are notorious for being very strict with regards to JSON parsing.

提交回复
热议问题