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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 7, 20262026-06-07T22:17:30+00:00 2026-06-07T22:17:30+00:00

I am using django-easy-maps to display maps on a my page and i have

  • 0

I am using django-easy-maps to display maps on a my page and i have some links on the sidebar and when the user clicks that link i want to refresh the map with the address in the link.

My django template of donate.html is this

{% block optionalcode %}
<script>
$(document).ready(function() {
$('.link').click(function() {
var n = $(this).attr("name");
n=n.replace(/\s/g,'+');
$('#results').html('&nbsp;').load('/donate/?n=' + n);
});
});
</script>


{% endblock %}

{% block contenttitle %}{% endblock %}

{% block content %}     
<div class="container-fluid">
<div class="row-fluid">
<div class="span8">


<div class="hero-unit" style="padding:10px 10px 10px 10px">

<div id="results">
<b> <pre class="prettyprint
linenums"> {{addr}} </pre> </b>
{% load easy_maps_tags %}
{% easy_map addr 725 400 %}     
</div>

</div>
</div>





{% endblock %} 

{% block sidebar %} 
<div class="span4">
    <div class="hero-unit" style="padding:10px 10px 10px 10px">

        <div class="accordion" id="accordion2">

       <div class="accordion-group">
              <div class="accordion-heading">
                <a class="accordion-toggle" data-toggle="collapse" data-parent="#accordion2" href="#collapseOne">
                  North Delhi
                </a>
              </div>
              <div style="height: 0px;" id="collapseOne" class="accordion-body collapse">
                <div class="accordion-inner">
                  <ol>
                  <li><a class='link' href="#" name="Some name1">Some link1</a> </li>
                  <li><a class='link' href="#" name="Some name2">Some link2</a> </li>




                  </ol>
                </div>
              </div>
            </div>


</div>
{% endblock %}

and my view code is here :

from django.shortcuts import render_to_response
from django.template import RequestContext
from django.http import HttpResponse

def ajax_req(request):
    if request.is_ajax():
        n = request.GET.get('n')
        return render_to_response('donate_res.html', {'addr': n},context_instance=RequestContext(request))


    else :
        return render_to_response('donate.html', {'addr': "Some Address"},context_instance=RequestContext(request))

and donate_res.html is just a small piece that replaces the #results div code.

<b> <pre class="prettyprint linenums"> {{addr}} </pre> </b> 
  {% load easy_maps_tags %} 
  {% easy_map addr 725 400 using "easy_maps/map.html"%}

The problem is when i click the link the data is sent back to the page i know this because i can see the address but the map is not displayed.A quick look at the Web Developer console in firefox gives this error.

A call to document.write() from an asynchronously-loaded external script was ignored. @ http://127.0.0.1:8000/donate/

Please tell me what am i doing wrong or a workaround to remove this error…i am new to Django.

  • 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-07T22:17:31+00:00Added an answer on June 7, 2026 at 10:17 pm

    Take a look at this question. It should answer why it is not working.

    Also, personally I don’t agree with the way you are doing this. It is recreating and reloading the map every time you click on the link, which is not only inefficient but also in the long term you might run into issues being limited by the maximum number of times you can load a map from Google.

    I would recommend you to create your write your own javascript to load the map and the address or take a look at the code that django-easy-maps generates and see if rather than recreating the container and redownloading the map javascript you can just set the center of the map or the point where the marker should be.

    I could help more if you can paste the code that the django-easy-maps generates in {% easy_map addr 725 400 using "easy_maps/map.html"%}

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

Sidebar

Related Questions

I am using django-registration and would like to have a different page for failed
I have been using django ORM, it's nice and very easy, but this time
using django 1.4 I have a model with a datetimefield. I imported django.utils.timezone to
I`m using Django to send some emails with embedded images to my gmail account.
I using Django tagging project. That is was very stable project. Working on django
I am using Django Crispy Forms together with Twitter-bootstrap and following this page: http://django-crispy-forms.readthedocs.org/en/d-0/tags.html#bootstrap-layout-objects
I want to make something like http://www.djangosnippets.org/accounts/register/ using django..the register form. I am new
I'm using the Django Feeds Framework and it's really nice, very intuitive and easy
I am using model forms in Django to allow the user to enter in
so i am using django and the django_registration module. When i visit a page,

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.