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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 7, 20262026-06-07T11:22:45+00:00 2026-06-07T11:22:45+00:00

I have a really annoying problem. I got this bunch of code which runs

  • 0

I have a really annoying problem. I got this bunch of code which runs and should put some information from XML into several table slots.

var xmlDoc;
$(document).ready(function() {
    //Load XML
    importXML();
    ///////////////////////////////////////////////////////////////////////////////////////
});

function importXML() {
    $.ajax({
        type: "GET",
        url: "adList.xml",
        dataType: "xml",
        success: assignXML
    });
}

function assignXML(myXML) {
    xmlDoc = myXML;
    pushContent();
}

function pushContent() {
    var len = xmlDoc.getElementsByTagName('advertisement').length;
    for (i = 0; i < len; i++) {
        var trElement = document.createElement('tr');
        console.log($(xmlDoc).find('advertisement').eq(i).find('image').text());
        var image = $(xmlDoc).find('advertisement').eq(i).find('image').text();
        var imageTD = document.createElement('td');
        var imageIn = document.createElement('input');
        imageIn.setAttribute('type', 'text');
        imageIn.setAttribute('name', 'imageArr[]');
        imageIn.setAttribute('size', '15');
        imageIn.setAttribute('value', image);
        imageTD.appendChild(imageIn);
        trElement.appendChild(imageTD);
        console.log(trElement);
    }

All of the information is there. I can look up the tr in the javascript code with firebug and it works correctly. It isn’t throwing any errors. It just doesn’t show up on the page or in the html. 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-07T11:22:47+00:00Added an answer on June 7, 2026 at 11:22 am

    Change this…

    var trElement = document.createElement('tr');
    

    to this…

    var table = document.getElementById('my_table'),
        trElement = table.insertRow(table.rows.length);
    

    DEMO: http://jsfiddle.net/7gDhq/1/

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

Sidebar

Related Questions

have a really annoying time developing some code for a set of UserControls that
I've got a very annoying problem with some code throwing an IndexOutOfBoundsException and I
I really have problem with this one. So I have a jar with a
i've got this snazzy python code: import subprocess value = subprocess.Popen([php,./php/php_runner.php],stdout=subprocess.PIPE); the problem is,
Hey guys, I have another really annoying problem in IE. I am using a
I do experience a really annoying problem with TestNG and RESTeasy. I do have
This is really annoying me as I have done it before, about a year
I have a very annoying problem with jQuery and the datepicker from jQuery-UI. Here
At my company we have a really annoying problem with our linker (ld 2.17).
I have recently discovered an annoying problem in some large program i am developing;

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.