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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 31, 20262026-05-31T08:11:04+00:00 2026-05-31T08:11:04+00:00

I am trying to render only the table for the response to the AJX

  • 0

I am trying to render only the table for the response to the AJX call, but it renders the whole template.
How can I only render the table while using render_to_response?

Template:

<html>
    <head>
        <title> Hash Searcher </title>
        <script type="text/javascript" src="{{STATIC_URL}}jquery.min.js"></script>
        <script type="text/javascript">
            $(document).ready(function() {
                $('#searchSubmit').click(function() {
                    q = $('#q').val();
                    $('#results').html('&nbsp;').load('/?mdhash=' + q );

                });
            });
            $(document).ajaxStart(function() {
                $('#spinner').show();
            }).ajaxStop(function() {
                $('#spinner').hide();
            });
        </script>
    </head>
    <body style="text-align: center; ">
        <input id="q" type="text" name="mdhash" value="{{ mdhash }}" style="text-align: center; "size=60 />
        <br>
        <input id="searchSubmit" type="submit" value="Search" />
        <br>
        <div style="display:none" id="spinner"><img src="{{STATIC_URL}}spinner.gif"/></div>
        <br>
        <span id="results">
        {% if plain %}
        <table>
            <tbody>
                <tr>
                    <td><small>#</small></td>
                    <td><small>Hash</small><br></td>
                    <td><small>Clear</small><br></td>
                    <td><small>Type</small><br></td>
                    <td><small>DB</small><br></td>
                </tr>
                {% for hash, clear in plain.items %}
                <tr>
                    <td><small>{{ forloop.counter }}</small></td>
                    <td><small>{{ hash }}</small><br></td>
                    <td><small><strong>{{ clear.0 }}</strong></small><br></td>
                    <td><small>{{ clear.1 }}</small><br></td>
                    <td><small>{{ clear.2 }}</small><br></td>
                </tr>
                {% endfor %}
            </tbody>
        </table>
        {% endif %}
        </span>
    </body>
</html>

View:

from django.shortcuts import render_to_response
from django.http import HttpResponse
from django.template.context import RequestContext
import core.models, time

def search(request):
    req = request.GET.get('mdhash', '')
    plain = {}
    try:
        plain[req] = (core.models.Hash_md5.objects.get(hash=req).plain, 'md5', 'iCrack')
    except:
        pass
    #aif request.is_ajax():
    #    time.sleep(5)
    #    return HttpResponse({plain: 'plain'})
    #else:
    return render_to_response('index.html', locals(), context_instance = RequestContext(request))
  • 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-31T08:11:06+00:00Added an answer on May 31, 2026 at 8:11 am

    If you factor the <table> part of the template out (and include it in the page template using {% include ... %}), then you can just render that sub-template if request.is_ajax() and you’ll be able to replace just that part of the page via jQuery.

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

Sidebar

Related Questions

I am trying to render a complex XML document as webpage(FF only) using a
I am trying to render a table using adf treeTable component. The table has
Im trying to render a django template from a database outside of djangos normal
I'm trying to render the sortable table that's provided in Google visualization API in
I'm trying to render an in-memory (but not in hierarchy, yet) UIViewController's view into
I am trying to render the magento contact form into a .phtml file, but
I am trying to get shadow mapping working using GLSL. Unfortunately my depth render
Im trying to render a non power of 2 texture using a model class
I'm trying to render only the first 20 items in a backbonejs collection. If
I'm trying render the results of surveys from Surveryor gem as a CSV file,

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.