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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 4, 20262026-06-04T13:43:13+00:00 2026-06-04T13:43:13+00:00

I am attempting to learn Django and Javascript/jQuery for a personal project. I want

  • 0

I am attempting to learn Django and Javascript/jQuery for a personal project. I want to plot some data using Flot and I am attempting to get a test plot to render but I seem to be doing it wrong.

In my base.html I have the following to include both jQuery and Flot in my head element.

<script src="/site_media/jquery-1.7.2.min.js" type="text/javascript"></script>
<script src="/site_media/jquery.flot.min.js" type="text/javascript"></script>

In my inherit.html:

{% extends 'base.html' %}

<script type="text/javascript">
alert('Im running!');
$.plot($("#flot-test"), [ [[0, 0], [1, 1]] ], { yaxis: {max: 1 } });
</script>
{% block title %}Detail View for {{ sched_name }}{% endblock %}

{% block content %}
<div id="status_bar">
    <a href="/view_schedules/">{{ user.username }}'s Gradebooks</a> / <a href="/view_schedules/{{ schedule_slug }}/">{{ sched_name }}</a>
</div>

<div id="flot-test" style="width:600px;height:300px">
</div>

The rest concatenated 

However when I render the page using the Django dev. server I get no alert like I included and the plot does not render. I get a blank div to the dimensions I have specified. When I actually look at the source of my page in my web browser it does not even show my plot script that I have included above. What am I doing wrong?

  • 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-04T13:43:15+00:00Added an answer on June 4, 2026 at 1:43 pm

    The JS is executing before the target div has been rendered. You can move the div before the inline JS or wrap the JS call in a document.ready:

    <script type="text/javascript">
    $(document).ready(function(){ 
        alert('Im running!');
        $.plot($("#flot-test"), [ [[0, 0], [1, 1]] ], { yaxis: {max: 1 } });
    });
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Greetings from some noob trying to learn JQuery, I am attempting to make it
I am attempting to learn J and the book I am using says this
I'm attempting to learn IronPython, to broaden my .NET horizons. I want to be
I'm attempting to learn some flex/bison, and I'm reading Flex & Bison by John
Currently, I'm trying to learn Javascript by writing my code in Gedit then attempting
I'm attempting to learn Sencha Touch (and Ext JS, being more of a jquery
I'm attempting to learn WPF by unravelling a frankly nightmarish project written by the
I'm a Perl programmer who's attempting to learn Python by taking some work I've
I'm attempting to learn Ruby on Rails by creating a project and I can't
I am new to Jquery Mobile and attempting to learn it as I redevelop

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.