Json Load Question - Simply Function Modification

Hey,

Simply put, when I load JSON in the following format:

var upny_iniresults = { 


    "q_cdata" : [

		{ "a_id" : "1", "a_txt" : "yes", "a_perc" : "12.50", "t_r" : "5" },

		{ "a_id" : "2", "a_txt" : "no", "a_perc" : "5.00", "t_r" : "2" },

		{ "a_id" : "3", "a_txt" : "not sure", "a_perc" : "5.00", "t_r" : "2" }


]
}

Into a function that prints out the data, such as below, everything works fine. Here is the function:



function upny_liRes() {

    var j = 0;
    var a_html = new Array();
    

    for(i = 0;i < [B]upny_iniresults.q_cdata.length[/B];i++) {

        var t_html = '';
    
        t_html += '<div class="upny_rlistttl">';
        t_html += [B]upny_iniresults.q_cdata[i].a_txt;[/B]
        t_html += '<br><span id="tr_';
        t_html += [B]upny_iniresults.q_cdata[i].a_id[/B];
        t_html += '" class="upny_trtxt"></span>';
        t_html += '</div><div class="upny_rlistcbr"><div style="position:relative;height:24px;"><div class="upny_rlistcbr1" style="width:1px;" id="a_';
        t_html += upny_iniresults.q_cdata[i].a_id;
        t_html += '"><div id="ap_';
        t_html += upny_iniresults.q_cdata[i].a_id;
        t_html += '">0';
        t_html += '&#37;</div></div><div class="upny_rlistcbr2"><div id="ap2_';
        t_html += upny_iniresults.q_cdata[i].a_id;
        t_html += '">0';
        t_html += '%</div></div></div></div><div class="upny_clear"></div>\
';

        a_html[j] = t_html;
        
        j++;
        
    }

  blah blah..
    
}

Here’s the question. I know that a var is created and that json data is stored and printed out cleanly through that upny_lires function. What I’d like to know is how to do the same thing, but with json output that has the same data, but in this unique format (without a variable, such as upny_iniresults)

({

"res_json" : [



        { "a_id" : "12", "a_txt" : "Heck no!", "a_perc" : "17.50", "t_r" : "7" },

        { "a_id" : "13", "a_txt" : "Sure!", "a_perc" : "20.00", "t_r" : "8" }

]

})

The goal is to have the above funciton, upny_lires, load
the res_json data, which has the same data overall, just like
it loads the upny_iniresults json data.

I can’t figure out how to replace the references to upny_iniresults
with res_json in the upny_lires function and it’s driving me nuts.

Thanks for your time.

PS. The reason I don’t go into why this is key is to avoid a more complicated situation. Just trust me
when I tell you that being able to solve it, as requested, would make my new year. :wink:

Just bumping hoping that somebody can confirm. I know
how to load it using the original json format where there is a variable for iniresults
but I can’t load it with the 2nd json type. I know the 2nd json type is acceptable as it works with other jquery functions.

This will help me solve a weeks long nightmare for a project where the designer left. I would greatly appreciate any guidance as I am so close.

TY.