How to include array content in HTML?
<p>I have this code</p>

<pre><code>var users = result.users; // array

$("#dialog:ui-dialog").dialog("destroy");

$("#dialog-confirm").dialog({
    resizable: false,
    height: 140,
    modal: true,
    open: function() {
    $(this).children('div.dialog-text').replaceWith("&lt;b&gt;New text goes here&lt;/b&gt;");
    },

    buttons: {
    "Okay": function() {
        $(this).dialog("close");
    },
    Cancel: function() {
        is_okay = 0;
        $(this).dialog("close");
    }
    }
});
</code></pre>

<p>where the array contain data in the form of</p>

<pre><code>{"ss":"Sandra Schlichting","fn":"Full name"}
</code></pre>

<p>What I am trying to accomplish is to get the content of the arrays in the form of (white space inserted for readability)</p>

<pre><code>&lt;table&gt;
  &lt;tr&gt;  &lt;td&gt;Initials&lt;/td&gt;  &lt;td&gt;Full Name         &lt;/td&gt;  &lt;/tr&gt;
  &lt;tr&gt;  &lt;td&gt;ss      &lt;/td&gt;  &lt;td&gt;Sandra Schlichting&lt;/td&gt;  &lt;/tr&gt;
  &lt;tr&gt;  &lt;td&gt;fn      &lt;/td&gt;  &lt;td&gt;Full name         &lt;/td&gt;  &lt;/tr&gt;
&lt;/table&gt;
</code></pre>

<p>and have that replaced with <code>&lt;b&gt;New text goes here&lt;/b&gt;</code> in</p>

<pre><code>$(this).children('div.dialog-text').replaceWith("&lt;b&gt;New text goes here&lt;/b&gt;");
</code></pre>

<p>From what I can tell <a href="http://api.jquery.com/jQuery.each/" rel="nofollow"><code>$.each()</code></a> should be used for this.</p>

<p>But still I can't quite figure out how to get started.</p>

<p>Can anyone help me out?</p>
