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 989851
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 16, 20262026-05-16T05:51:28+00:00 2026-05-16T05:51:28+00:00

This is my ajax function: function ajax_call(call_method,data_to_send) { logger(function ajax_call. var data_to_send: ); logger(data_to_send);

  • 0

This is my ajax function:

function ajax_call(call_method,data_to_send) {
    logger("function ajax_call. var data_to_send: ");
    logger(data_to_send);
    $('.clickable save_button').hide()
    $.ajax({
      type: 'POST',
      url: call_method,
      data: data_to_send,
      success: function(data){
            logger("data returned to page after ajax call: ");
            logger(data);
            $('.error_msg').html("Successfully saved record to database.");
            $('.error_msg').fadeIn('slow');
            setTimeout("$('.error_msg').fadeOut('slow');",5000); // 5 secs to give user enough time to read
            $('.clickable save_button').show()
            response_dispatcher(data); // This should contain object type at least
      },
      failure: function(){
            $('.error_msg').html("There was an error while saving this information. Please try again. " +
                                    "If the error persists, please contact us using the contact form.");
            $('.error_msg').show;
            $('.clickable save_button').show()
      },
      dataType: 'json'
    });
}

And, this is the data sent to my method on the backend:
{
‘display_order’:”3″,
‘goal’:”dummy goal”,
‘id’:-1,
‘object_type’:”goal”
}

I’ve verified within my application that this same data is received.

Here is my Django view method:

@login_required
def update_goal_view(request):

    if request.method == 'POST' and request.is_ajax:
        # Example data sent from AJAX Request
        #qd = {u'display_order': [u'23'], u'object_type': [u'goal'], u'goal': [u'dummy goal'], u'id': [u'-1']}
        qd = request.POST
        goal = qd.get('goal','')
        display_order = qd.get('display_order',99999)
        id = int(qd.get('id',''))
        object_type = qd.get('object_type','')

    # For now, just return something to test populating data to the page
    id = '100'
    goal = 'goal returned'
    object_type = object_type
    data = {'id':id,'goal':goal,'object_type':object_type}
    return HttpResponse(data,mimetype="application/json")

In Firebug, I see this after the ajax call:

POST http://127.0.0.1/xml/update_goal 200 OK 12ms

The issue is, when that it appears that my success callback is never called… I say that because as you can see from above, I there should be a message written to my logger but there isn’t one. I know my logger works because of all the other messages outside of the callback that do get written to my logger.

  • 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-05-16T05:51:29+00:00Added an answer on May 16, 2026 at 5:51 am

    I don’t think Django does automatic serialization for dictionaries. You’ll have to serialize them to JSON by hand.

    import simplejson
    
    # ...
    
    return HttpResponse(simplejson.dumps(data), mimetype="application/json")
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Ask A Question

Stats

  • Questions 510k
  • Answers 510k
  • Best Answers 0
  • User 1
  • Popular
  • Answers
  • Editorial Team

    How to approach applying for a job at a company ...

    • 7 Answers
  • Editorial Team

    What is a programmer’s life like?

    • 5 Answers
  • Editorial Team

    How to handle personal stress caused by utterly incompetent and ...

    • 5 Answers
  • Editorial Team
    Editorial Team added an answer You just need to "escape" the slashes with the backslash.… May 16, 2026 at 4:50 pm
  • Editorial Team
    Editorial Team added an answer Do you have a route set for that action? May 16, 2026 at 4:50 pm
  • Editorial Team
    Editorial Team added an answer Actually, just going with Google's translation API is probably the… May 16, 2026 at 4:50 pm

Trending Tags

analytics british company computer developers django employee employer english facebook french google interview javascript language life php programmer programs salary

Top Members

Related Questions

I have a error when I tried to send post data with ajax() method.
I'm using this code: $newFilter = getNewFilter(); $fieldDropdown = getFieldDropdown(fieldData.field); $newFilter.append($fieldDropdown); $typeDropdown = getTypeDropdown($fieldDropdown.data('zenfilter').fieldId,
I am using Rails and jQuery, making an ajax call initiated by clicking a
I want to use jQuery's .get method to send an ajax call to the
This is a fairly recurring theme on StackOverflow, but once again I can't get
A few days ago I posted this question: switch statement and loops using jquery/javascript
I am making a sequence of Ajax calls using the Ext.Direct module. I want
So basically I have a form with browser filters for data I'm displaying. I
This is kind of I already lost x hours debugging this kind of problem/question
I have a form with the following HTML below: <form id=course_edit_form name=course_form action=/courses/save method=post>

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.