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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 6, 20262026-06-06T23:38:28+00:00 2026-06-06T23:38:28+00:00

In my application, I make an ajax call that renders this template with js:

  • 0

In my application, I make an ajax call that renders this template with js:

<div id="ajax_reply">
<div id="hidden_data" style="display:none;"></div>
<script type="text/javascript">
var data = [];
data.push(['Col1', 'Col2', 'Col3', 'Col4']);
{% for entry in mydata %}
  var dCell = [];
  dCell.push({{ entry.Col1 }});
  dCell.push({{ entry.Col2 }});
  dCell.push({{ entry.Col3 }});
  dCell.push({{ entry.Col4 }});
  data.push(dCell);
{% endfor %}
document.getElementById('hidden_data').innerHTML = JSON.stringify(data);
</script>
</div>

This doesn’t work, if I run the resulting js manually in console, it does get inserted into the div, but otherwise, the javascript is never executed. I’ve searched on SO but couldn’t find questions on this exact topic. hidden_data is in scope, any suggestions?

EDIT:
Code seen in console after wrapping in onload (I had to make a few edits but running this manually in console works)

<div id="ajax_reply">
<div id="hidden_data" style="display:none;"></div>
<script type="text/javascript">
window.onload = function() {
    var data = [];
    data.push(['Col1', 'Col2', 'Col3', 'Col4']);

      var dCell = [];
      dCell.push('1233');
      dCell.push('123312');
      dCell.push('1233');
      dCell.push('1482.61');


      data.push(relation);

      var dCell = [];
      dCell.push('1231');
      dCell.push('2112.0');
      dCell.push('1231');
      dCell.push('123123.00');


      data.push(relation);

  document.getElementById('hidden_data').innerHTML = JSON.stringify(relationsData);
};
</script>
</div>
  • 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-06T23:38:30+00:00Added an answer on June 6, 2026 at 11:38 pm

    If entry.Col1 contains string ‘my text’, resulting template will give you lines like this:

    dCell.push(my text);
    

    and, i suppose, you need

    dCell.push('my text');
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a problem with an AJAX call that i make to login a
I want a HTML/javascript application, running in a WebView to make AJAX calls that
I'm trying to make an AJAX call to a model that I have in
I'm building an ajax application and I have a choice to make on how
I'm developing an application which make use of display lists offered by OpenGL. My
I'm trying to make application for tablet with Android 2.3 with this kind of
I am working on an ASP.NET application that make a lot of jquery and
I have been trying to test my application to make sure that all the
I'm building an interactive javascript application that needs to make some SOAP requests to
I'm creating a web application that will use a lot of ajax calls. The

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.