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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 29, 20262026-05-29T22:55:22+00:00 2026-05-29T22:55:22+00:00

I am using Django and AJAX in a project where I am building an

  • 0

I am using Django and AJAX in a project where I am building an activity feed. The way it works, we show both friend activity and global activity. This is what my HTML looks like:

<div>
  {% include "friend_reviews.html" %}
  <div id="load-friends"></div>
</div>
<div>
  {% include "global_reviews.html" %}
  <div id="load-global"></div>
</div>
<a id="load-more" href="/load/feed/2">
  Load More
</a>

I want to write a jQuery AJAX function that will load additional reviews into #load-friend and #load-global. Consequently, I wrote a Django view (which intercepts /load/feed/2) that queries the database and returns:

context = {'friend_reviews': friend_reviews, 'global_reviews': global_reviews'}

Both friend_reviews and global_reviews are QuerySets of Review objects. If you plug friend_reviews into the friend_reviews.html partial template, then it will generate the appropriate HTML on the page.

However, I am not that familiar with jQuery and do not know what’s the best way to generate the correct HTML. I have heard about Taconite but there are no examples in Python so any help would be greatly appreciated.

  • 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-29T22:55:23+00:00Added an answer on May 29, 2026 at 10:55 pm

    Include jquery library in the head of your page.

    Then, this will do the job :

    $(document).ready(function(){   
        $.get("friend_reviews.html",function(data){     
                $('#load-friends').html(data);
          });
        $.get("global_reviews.html",function(data){     
                $('#load-global').html(data);
          });
    });
    

    If you want to do it by clicking on the link then you can use following

    // html
    <a id="load-more">Load More</a> 
    
    // Javascript
    $(document).ready(function(){
        $('#load-more').click(function(){
        $.get("friend_reviews.html",function(data){     
                $('#load-friends').html(data);
          });
        $.get("global_reviews.html",function(data){     
                $('#load-global').html(data);
          });
                                       });
    });
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am working on form validation with AJAX using Dajax in a Django project.
I'm trying to learn some basic ajax using Django. My simple project is an
I am using django-postman to provide user-to-user message facility and this uses django ajax-selects
I using Django tagging project. That is was very stable project. Working on django
I'm trying to AJAX-ify the Django contact_form app using Django (1.4.2). I want to
I was following the directions at http://django-dajaxice.readthedocs.org/en/latest/installation.html to install Dajaxice for simple AJAX support
I'm trying to write a simple search server, using Django with AJAX. The server
I'm using django and jquery to implement authenticated sessions and Ajax requests. I have
Looking to get some insight and tips on using ajax with django. Say I
I am using this code if form.is_valid(): form.save() if request.POST.get('ajax') == 'true': return HttpResponse('Data

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.