Skip to content

Instantly share code, notes, and snippets.

@nonZero
Created November 18, 2015 15:22
Show Gist options
  • Save nonZero/2c559e17a736ed9595fd to your computer and use it in GitHub Desktop.
Save nonZero/2c559e17a736ed9595fd to your computer and use it in GitHub Desktop.
simple ajax
"use strict";
$(function () {
$.get("/the/url/of/the/maps/", function (maps) {
$.each(function (i, map) {
console.log(map);
})
});
});
def my_view(request):
maps = models.Map.objects.all()
return JsonResponse([{
'id': map.id
} for map in maps])
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment