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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T21:32:57+00:00 2026-05-26T21:32:57+00:00

In a Django template, I have a function function show_graph(i){ $(#+i+seegraph).click(function(){ $(#+i+graph).show(); var qaa

  • 0

In a Django template, I have a function

function show_graph(i){
    $("#"+i+"seegraph").click(function(){
        $("#"+i+"graph").show();

    var qaa = {{ question_ids }};

    var qid = qaa[i-1];
        jQuery.ajax({
            url: "/canvas/recreatechart/",
            type: "get",
            data: {qid: qid },
            success: function(response){
                var resp = jQuery.parseJSON(response);
                alert("chart1"+i);
                show_graph("chart1"+i, resp['chart_type'], resp['series_names'], JSON.stringify(resp['data1']), resp['answer'], resp['stories1'], resp['colors'], resp['stacked'], resp['title1']);

                show_graph(resp['second_graph']+i,resp['chart_type'], resp['series_names'], resp['data2'], resp['answer'], resp['stories2'], resp['colors'], resp['stacked'], resp['title2']);
            }

        });

    });
}

and an alert immediately inside show_graph, from which I’ve deduced that show_graph just isn’t getting called, but I don’t know why.

I don’t have any errors in my console, when I tried alerting each argument in the first call one by one, they all showed up as expected, although “data1” showed up as “object Object” with a type of “object” (When I stringified data1, it came out as expected, although I don’t know if that means anything).

Note that data1 is an array of dictionaries, the values of which are arrays of arrays. So, slightly complicated, and I’m not sure if js can parse the structure.

Is that why my function is not getting called? If not, what is it? If so, how do I fix it (given that this is the format I have to pass my data in). How can I find the problem?

EDIT: I would also like to note that I just tested something simple like [5] in place of data1, as that’s what I was afraid was messing up the function call, but I’m still not getting the alert from show_graph, so I think that’s not it after all.

  • 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-26T21:32:58+00:00Added an answer on May 26, 2026 at 9:32 pm

    You’re already inside of a function called show_graph. Instead of calling the function you want, it’s calling itself, and adding another click action to…a jquery selector that doesn’t match anything. So rename your inner function and everything should work.

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

Sidebar

Related Questions

I've got a problem with using django's {% trans %} template function. I have
I have a page which uses jQuery for some AJAX-stuff und Django as main
I have a django template that looks like this: <head> <script src=http://ajax.googleapis.com/ajax/libs/jquery/1.5/jquery.min.js type=text/javascript></script> <script
I have a Django template that I want to extend in multiple places. In
I have a basic question, in the Django template language how can you tell
I have some french letters (é, è, à...) in a django template but when
Does Django have any template tags to generate common HTML markup? For example, I
I am running Django trunk and have template Autoescaping on (default). Do I need
I have in my Django controller a function that is called as follows: trip.driverTrip.filter(status='pending')
I have an urls.py with this line: url(r'^logout/$', 'django.contrib.auth.views.logout', name=auth_logout), In my template tag

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.