Open Jquery dialog from inside Ajax request?
<p>I have a problem with my current javascript/ajax request. I'm trying to open a Jquery dialog from inside my <code>.append</code> my code follows: </p>

<pre><code>for (var i in rows)
{
  var row = rows[i];          
  var id = row[0];
  var NewEdit = row[0];
  var PreviousEdit = row[1];
  var FunctionName = row[2];
  var FunctionID = row[2]
  function ShowInfo() 
  {
    dialog('Original: &lt;br&gt;'+PreviousEdit+'&lt;br&gt;&lt;br&gt; New: &lt;br&gt;' +NewEdit);
  }
  $('#RecentEdits').append("&lt;br&gt;Page: &lt;a href=Page.php?ID="+FunctionID+"&gt;"+FunctionName+"&lt;/a&gt; - &lt;a href='#' OnClick='ShowInfo()'&gt;Info&lt;/a&gt;");
} 
</code></pre>

<p>I have only pasted relivant code, if required I can post the entire function.</p>

<p>I know for a fact, my variables are correctly set due to them being printed out.</p>

<p>How can I open up a Dialog box showing more information from inside a Javascript function?</p>

<hr>

<p><strong>Solution:</strong></p>

<p>As there is no correct replies. I have used OQJF's example and produced this: </p>

<pre><code>    &lt;script&gt;
function ShowInfo(a,b) 
      {
       alert('Original: \n'+unescape(a)+'\n\n New: \n'+unescape(b));
      };
    &lt;/script&gt;
   &lt;script&gt;
//window.setInterval(function()
//{
  $(function () 
  {
    $.ajax({                                      
        url: 'RecentUpdates.php', data: "", dataType: 'json',  success: function(rows)        
        {
        $('#RecentEdits').empty();

            for (var i in rows)
            {
                var row = rows[i];          
                var id = row[0];
                var NewEdit = row[0];
                var PreviousEdit = row[1];
                var FunctionName = row[2];
                var FunctionID = row[3];
                $('#RecentEdits')
                .append("&lt;br&gt;Page: &lt;a href='Page.php?ID="+FunctionID+"'&gt;"+FunctionName+"&lt;/a&gt; - ");
                $('#RecentEdits').append("&lt;input type='button' onClick=ShowInfo('"+escape(PreviousEdit)+"','"+escape(NewEdit)+"'); value='Show'&gt;");
            } 
        } 
    });       
  });
// }, 1000);
  &lt;/script&gt;
</code></pre>

<p>which has enabled me to access the function from my Javascript printout.</p>

<p>I had troubles with the quotes wrapped around my html  so i have decided to make two appends. And this seems to work just fine!</p>
