0

I'm using following ajax code:

  $.ajax({
    type: "POST",
    url: "/home/ajax/graph/"+ atr,
    dataType: "html",
    data:{
      group_id : '{{groupid}}',
      csrfmiddlewaretoken: '{{ csrf_token }}',
      node_id : atr 
    },
    success: function(result) {
         $("#info").html(result);
    },
    complete: function(){   }
  });

the url and view are working properly. The data goes till the last template by the help of redirection from view file.

view code :

def adminRenderConceptGraph(request,group_id,node_id=None):
  if request.is_ajax() and request.method == "POST":
    group_name = u'home'
    if node_id:
    req_node = node_collection.one({'_id':ObjectId(node_id)})
    template = 'ndf/graph_concept.html'
    variable = RequestContext(request, {'node':req_node })
    return render_to_response(template,variable) 

its corresponding url is:url(r'^graph/(?P<node_id>[^/]+)$', 'adminRenderConceptGraph', name='adminRenderConceptGraph'),

It's suppose to display a graph in the overlay. The data reaches the graph template in the overlay and this is the warning shown in the console. The screen just freezes.

Synchronous XMLHttpRequest on the main thread is deprecated because of its detrimental effects to the end user's experience. For more help, check http://xhr.spec.whatwg.org/.

s_user
  • 586
  • 2
  • 8
  • 19

1 Answers1

1

This could happen it you have a <script src="/somescript.js"></script> tag in yout template, that you are returning via AJAX (that is template ndf/graph_concept.html). More info at related question https://stackoverflow.com/a/28478146/3906845

Community
  • 1
  • 1
Flaiming
  • 413
  • 2
  • 14