Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7915645
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 3, 20262026-06-03T14:31:25+00:00 2026-06-03T14:31:25+00:00

I have this following view which I get data from a model and thereafter

  • 0

I have this following view which I get data from a model and thereafter serialize it into JSON.

views.py

def polling(request):
    if request.is_ajax():
        data = UserReview.objects.filter(movie_id=request.GET['m_id'])
        serializers.serialize('json', data)
        return HttpResponse(data, mimetype='application/json')
    else:
        raise Http404

At the client side I want to show this content now. I’m using jQuery’s function getJSON to archive this. It won’t show anything, and the setTimeout doesn’t work as well. But I get a response when I debug it with firebug, it however doesn’t call the alert() function to view the data. I’ve been trying to figure out what the problem could be for some time now. So I wonder if there’s something wrong with my script?

javascript

function polling() {
    $.getJSON(  "/polling/", 
                {m_id: {{movie_info.id}} },
                function(data) {
                    alert(data)
                    setTimeout(polling, 5000)
                });
    };
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-03T14:31:28+00:00Added an answer on June 3, 2026 at 2:31 pm

    Some general methods that will help you find out what is wrong.

    1. Use console.log very liberally on the front end to make sure everything is going as planned

    2. http://api.jquery.com/jQuery.ajax/ Callback functions as suggested in a comment, make sure you at least logg an error

    3. https://docs.djangoproject.com/en/dev/topics/logging/ set up a debug logger, make sure that you can see what is going on and what django is actually returning as json.

    4. http://docs.python.org/library/pdb.html Better yet drop this badboy anywhere in your code and MAKE SURE that everything is going the right way. If your success is not being called ont the front end i bet the error is in django! find out where.

    5. You can view the errors in the HTML tab in firebug if debug=True or you can just request /polling/ through your browser and view the django error screen.

    using some or any of these should put you in a fine place to solve your problem django dev server makes it an absolute ease to breeze through these errors please do some research and find out the many many debug tools made available to you!

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have this following IEnumerable LINQ query: var query = from p in Enumerable.Range(2,
I have this following setup, a textarea named with some data in it that
I have this following code which will return all the current semesters. How do
I have this code I want to bind data to grid view without using
I have an ASP.Net MVC view which inherits from a ViewModel. The ViewModel contains
Hello I have the following code to retrieve data from my db using nhibernate
not sure how to word this correctly.. so i have a view which has
1] I have the following model: class UserReportedData(db.Model): #country selected by the user, this
I have this following code, here CssClass is of the String type. <asp:Panel ID=Panel1
I have this following numpy matrix that I want to sort in ascending order

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.