i tried to retrieve data from django to jquery by using get
this is my $get in jquery
$.get("/video/",
{
video_page: page_number
},
function(data){
for (var i = 0; i < data.length; i++){
alert(data[i]['name']);
}
});
this code calls to view "video" of django
def video(request):
page = int(request.GET['video_page'])
print page
obj = Video.objects.all().order_by('date_time')
return HttpResponse(obj)
why i use alert(data[i]['name']); but it prompts undefined?
thanks
--
You received this message because you are subscribed to the Google Groups
"Django users" group.
To view this discussion on the web visit
https://groups.google.com/d/msg/django-users/-/idGkOipyZocJ.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to
[email protected].
For more options, visit this group at
http://groups.google.com/group/django-users?hl=en.