jQuery does not send request, but still receives success

78 views Asked by At

I am using select2 and x-editable libs.

I want to select some tags at select2 box, and send a request to django. The thing is that script does not send any request (nothing is in console), but somehow thinks, that success message is recieved.

views.py:
def lookup(request):
    print request
    c = {'request': request}

    response = render_to_response('res_candidates.html', c)
    return response




script:

$.ajaxSetup({
    beforeSend : function(xhr, settings) {
        console.log(xhr);
    }
  });


$('.search-jobs').editable({
    url: '/lookup/',
    name: 'jobs',
    mode: 'popup',
    select2: {
        tags: ['C++dev', 'researcher', 'candidate', 'trainee'],
        tokenSeparators: [",", " "]
          },

    success: function(data, config) {
             alert(data);

    },
}); 
0

There are 0 answers