Javascript converting example to real code issue - arrays
<p>I'm trying to use the userBox plugin and in the example we have the following array being built:</p>

<pre><code>var data = [
    {text: "Adam Adamson",    id: "adam@test.com"},
    {text: "Betsy Boop",      id: "betsy@test.com"},
    {text: "Jooles Jooles",   id: "julie@test.com"}
];
</code></pre>

<p>I want to build my array at runtime using JSON data I receive from my webservice.
In my code I have tried to mimic this array with the following. </p>

<pre><code>    var data = new Array();

    for (var i = 0; i &lt; msg.d.ListExercise.length; i++) {
        $("userlist").append("msg.d.ListExercise[i].exercise_value");
        if (i &gt; 0 &amp;&amp; i &lt; msg.d.ListExercise.length - 1) {
            data.push('{text: ' + '"' + msg.d.ListExercise[i].exercise_value + '"' + ' , id: ' + '"' + msg.d.ListExercise[i].exercise_id + '"' + '},');
        }
        if (i == msg.d.ListExercise.length - 1) {
            data.push('{text: ' + '"' + msg.d.ListExercise[i].exercise_value + '"' + ' , id: ' + '"' + msg.d.ListExercise[i].exercise_id + '"' + '}');
        }
    }
</code></pre>

<p>From what I understand in the example he building a string array.  I have verified that the array is being added to and that the data is being added to it.  However, when I pass my array into the plugin code it shows the word 'Undefined' 135 times (the length of the array).</p>

<p>My Array looks something like this:</p>

<pre><code>{text: "Standard Push-Up" , id: "1"},
{text: "Wide Front Pull-Up" , id: "2"},
{text: "Vertical Punches" , id: "135"}
</code></pre>

<p>What is the best way to get my data into his array example in javascript?</p>
