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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 4, 20262026-06-04T17:49:59+00:00 2026-06-04T17:49:59+00:00

So I’m working on a web application that uses jquery to parse xml data

  • 0

So I’m working on a web application that uses jquery to parse xml data and add it to a table dynamically. Theres four tables that get toggled on the same part of the page. Here’s the relevant html:

<div id = "toggleSection">
<div id = "autoPrevData"></div>
<div id = "firePrevData"></div>
<div id = "auto1Data"></div>
<div id = "auto2Data"></div>
<div id = "auto3Data"></div>
</div>

And this is the Jquery function with AJax:

    $("#autoEarly").click(function() {
        if (!$("#firePrevData").is(":hidden")) {
            $("#firePrevData").toggle('slow');
        }
        if (!$("#auto1Data").is(":hidden")) {
            $("#auto1Data").toggle('slow');
        }
        if (!$("#auto2Data").is(":hidden")) {
            $("#auto2Data").toggle('slow');
        }
        if (!$("#auto3Data").is(":hidden")) {
            $("#auto3Data").toggle('slow');
        }
        if (loadedModels[0]) {
            loadedModels[0] = false;
            $.ajax
        ({
            type: "GET",
            url: "dashboard_auto.xml",
            dataType: "xml",
            success: parseXml_AutoEarly
        });
        }
        else {
            $("#autoPrevData").toggle('slow');
        }
        return false;

    });

And this is the function that actually parses the xml:

    function parseXmlEarlyPrevention(xml, xmlRoot, data) {
    //First Header
    $(data).append("<table><tr><th colspan='5'>Model Information</th><th colspan='4'>Score Metrics</th><th colspan='5' >Variable Metrics</th><th colspan='5' style='600;'>Pseudo-Standardized Coefficient Metrics</th></tr>");
    //Second headers
    $(data).append("<tr><td>&nbsp;</td><td>&nbsp;</td><td>&nbsp;</td><td>&nbsp;</td><td class='thickBorder'>&nbsp;</td><td colspan='2' style='font-size:1em; color:#888888; border-right:1px solid black'>PSI:</td><td colspan='2' style='font-size:1em; color:#888888; border-right:2px solid black;'>Divergence:</td><td colspan='2' style='font-size:1em; color:#888888; border-right:1px solid black;'>Divergence:</td><td colspan='3' style='font-size:1em; color:#888888; border-right:2px solid black;'>Largest Divergence:</td><td colspan='2' style='font-size:1em; color:#888888; border-right:1px solid black;'>Sum of Changes:</td><td colspan='3' style='font-size:1em; color:#888888;'>Largest Change in Relative Importance:</td></tr>");
    //Third Headers
    $(data).append("<tr><td>Model</td><td>Avg Rank</td><td>Benchmark</td><td>Current</td><td class='thickBorder'># in Curr Period</td><td>Rank</td><td class='thinBorder'>Value</td><td>Rank</td><td class='thickBorder'>Value</td><td>Rank</td><td class='thinBorder'>Average</td><td>1st</td><td>2nd</td><td class='thickBorder'>3rd</td><td>Rank</td><td style='border-right:1px solid black;'>Value</td><td>1st</td><td>2nd</td><td>3rd</td></tr>");

        var x = 1;
        $(xml).find(xmlRoot).each(function() {
            if (x % 2 == 1) {
                $(data).append("<tr>");
                $(data).append("<td class='dataCellBlue'><a href = 'modelInfo.php?model=" + $(this).find("model").text() + "$type=earlyPrev'>" + $(this).find("model").text() + "</a></td>");
                $(data).append("<td class='dataCellBlue'>" + $(this).find("avg_rank").text() + "</td>");
                $(data).append("<td class='dataCellBlue'>" + $(this).find("benchmark").text() + "</td>");
                $(data).append("<td class='dataCellBlue'>" + $(this).find("current").text() + "</td>");
                $(data).append("<td class='dataCellBlue thickBorder'>" + $(this).find("n_current").text() + "</td>");
                $(data).append("<td class='dataCellBlue " + $(this).find("psi_color").text() + "'>" + $(this).find("psi_rank").text() + "</td>");
                $(data).append("<td class='dataCellBlue thinBorder'>" + $(this).find("psi").text() + "</td>");
                $(data).append("<td class='dataCellBlue'>" + $(this).find("divergence_rank").text() + "</td>");
                $(data).append("<td class='dataCellBlue thickBorder'>" + $(this).find("divergence").text() + "</td>");
                $(data).append("<td class='dataCellBlue" + $(this).find("var_color").text() + "'>" + $(this).find("var_div_rank").text() + "</td>");
                $(data).append("<td class='dataCellBlue thinBorder'>" + $(this).find("avg_var_div").text() + "</td>");
                $(data).append("<td class='dataCellBlue" + $(this).find("worst_div_col1").text() + "'>" + $(this).find("worst_div1").text() + "</td>");
                $(data).append("<td class='dataCellBlue" + $(this).find("worst_div_col2").text() + "'>" + $(this).find("worst_div2").text() + "</td>");
                $(data).append("<td class='dataCellBlue thickBorder" + $(this).find("worst_div_col3").text() + "'>" + $(this).find("worst_div3").text() + "</td>");
                $(data).append("<td class='dataCellBlue" + $(this).find("psc_color").text() + "'>" + $(this).find("psc_rank").text() + "</td>");
                $(data).append("<td class='dataCellBlue thinBorder'>" + $(this).find("sum_psc").text() + "</td>");
                $(data).append("<td class='dataCellBlue" + $(this).find("worst_psc_col1").text() + "'>" + $(this).find("worst_psc_var1").text() + "</td>");
                $(data).append("<td class='dataCellBlue" + $(this).find("worst_psc_col2").text() + "'>" + $(this).find("worst_psc_var2").text() + "</td>");
                $(data).append("<td class='dataCellBlue" + $(this).find("worst_psc_col3").text() + "'>" + $(this).find("worst_psc_var3").text() + "</td>");
                $(data).append("</tr>");
            }
            else {
                $(data).append("<tr>");
                $(data).append("<td><a href = 'modelInfo.php?model=" + $(this).find("model").text() + "$type=earlyPrev'>" + $(this).find("model").text() + "</a></td>");
                $(data).append("<td>" + $(this).find("avg_rank").text() + "</td>");
                $(data).append("<td>" + $(this).find("benchmark").text() + "</td>");
                $(data).append("<td>" + $(this).find("current").text() + "</td>");
                $(data).append("<td class='thickBorder'>" + $(this).find("n_current").text() + "</td>");
                $(data).append("<td class='" + $(this).find("psi_color").text() + "'>" + $(this).find("psi_rank").text() + "</td>");
                $(data).append("<td class='thinBorder'>" + $(this).find("psi").text() + "</td>");
                $(data).append("<td>" + $(this).find("divergence_rank").text() + "</td>");
                $(data).append("<td class='thickBorder'>" + $(this).find("divergence").text() + "</td>");
                $(data).append("<td class='" + $(this).find("var_color").text() + "'>" + $(this).find("var_div_rank").text() + "</td>");
                $(data).append("<td class='thinBorder'>" + $(this).find("avg_var_div").text() + "</td>");
                $(data).append("<td class='" + $(this).find("worst_div_col1").text() + "'>" + $(this).find("worst_div1").text() + "</td>");
                $(data).append("<td class='" + $(this).find("worst_div_col2").text() + "'>" + $(this).find("worst_div2").text() + "</td>");
                $(data).append("<td class='thickBorder" + $(this).find("worst_div_col3").text() + "'>" + $(this).find("worst_div3").text() + "</td>");
                $(data).append("<td class='" + $(this).find("psc_color").text() + "'>" + $(this).find("psc_rank").text() + "</td>");
                $(data).append("<td class='thinBorder'>" + $(this).find("sum_psc").text() + "</td>");
                $(data).append("<td class='" + $(this).find("worst_psc_col1").text() + "'>" + $(this).find("worst_psc_var1").text() + "</td>");
                $(data).append("<td class='" + $(this).find("worst_psc_col2").text() + "'>" + $(this).find("worst_psc_var2").text() + "</td>");
                $(data).append("<td class='" + $(this).find("worst_psc_col3").text() + "'>" + $(this).find("worst_psc_var3").text() + "</td>");
                $(data).append("</tr>");
            }
            x++;

        });
        $(data).append("</table>");
        $(data).toggle("slow");
    }

The problem is that only the html in the first $(data).append() call is being displayed and nothing afterwards. It works fine in safari and firefox, but it’s for work and I need it working on IE. I’ve been pouring the internet for hours trying to find a good explanation but so far I’ve had no luck, and frankly its driving me a bit nuts. Thanks for any help

  • 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-04T17:50:01+00:00Added an answer on June 4, 2026 at 5:50 pm

    DOM updates are expensive, and one would occur after each append in this situation. You’re far better off building this up as ONE string and inserting it in one step.

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

Sidebar

Related Questions

I'm working with an upstream system that sometimes sends me text destined for HTML/XML
That's pretty much it. I'm using Nokogiri to scrape a web page what has
I have a French site that I want to parse, but am running into
I'm parsing an RSS feed that has an &#8217; in it. SimpleXML turns this
link Im having trouble converting the html entites into html characters, (&# 8217;) i
I have a jquery bug and I've been looking for hours now, I can't
I have a string like this: La Torre Eiffel paragonata all&#8217;Everest What PHP function
I've got a string that has curly quotes in it. I'd like to replace
I am reading a book about Javascript and jQuery and using one of the
In my XML file chapters tag has more chapter tag.i need to display chapters

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.