I downloaded a bit old project from repo(didn't updated it for few months) and it appeared ajax doesn't work somehow. In pip freeze
I checked library I used djangoajax==2.4
In templates js code it looks like this:
ajaxPost('/authfb/', {'username': fb_name , 'fb_id': fb_id, 'csrfmiddlewaretoken': getCookie('csrftoken')}, function(){ });
And issue in browser logs is that Can't find variable:ajaxPost
I just don't know what that library was and maybe it's outdated? How to check?
Or can be problem connected with something else? I am sure it worked before. All ajax, js, jQuery links and etc is correct
To perform ajax client side use JQuery:
$.ajax({
type: "POST",
url: "/authfb/",
data: {'username': fb_name , 'fb_id': fb_id, 'csrfmiddlewaretoken': getCookie('csrftoken')},
success: function(){}
});
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.