更新时间:2023-12-05 16:28:16
请在你的urls.py中添加URL就像
Please add in your urls.py an url like
(r'^ajaxrequest$', 'app.views.iEventAjax')
再修改
$(document).ready(function() {
$.post("/ajaxrequest", {
lat : searchResult._point.__lat,
lng : searchResult._point.__lng,
text : searchResult.text
}, function(data) {
alert(data);
});
});
在你的你的应用程序的views.py
in your views.py of your app
def iEventAjax(request):
return HttpResponse("ok")