python学习-- django 2.1.7 ajax 请求 进阶版

   #原来版本

$.get("/add/",{'a':a,'b':b}, function(ret){ 
$('#result').html(ret)
})

#进阶版

 $.get("{% url 'add' %}",{'a':a,'b':b}, function(ret){

   $('#result').html(ret);
 })
 
#区别
 ‘/add/' 改成    {% url 'add' %}   
 
原文地址:https://www.cnblogs.com/ln-qiqi/p/10528812.html