title: ajax call into jquery dialog box with unique ID
body: <p>can anyone help please,... 
  I have a comments page with a link to report/spam that I want to call into dialog box with ajax,... how can I do this,..? thanks in advance,... 
  here is my code: </p>
  
  <pre><code>&lt;script&gt;
  
  $(function() {
   $('#photo_comments_opener_&lt;?php echo $photo_comment['PhotoComment']['id'] ?&gt;').dialog({
   autoOpen: false,
   width: 500,
   modal: true,
   title: 'Report Photo Comment',
  
      open: function ()
      {
          $.ajax(function(){
              url: "&lt;?php echo $html-&gt;url("/report/photo_comment/" . $photo_comment['PhotoComment']['id']) ?&gt;",
              data: data, 
              type: "post",
              sucess:function(msg){
                  $('#photo_comments_opener_&lt;?php echo $photo_comment['PhotoComment']['id'] ?&gt;').html(msg)
              }
          });
     }       
  
  });
  
    });
  &lt;/script&gt; 
  </code></pre>
  
  <p>and here is the link: </p>
  
  <pre><code>&lt;?php echo $html-&gt;link(ucfirst(__('report', true)), 'javascript:void(0)', array('id' =&gt; "photo_comments_opener_".$photo_comment['PhotoComment']['id'], 'class' =&gt; 'report')) ?&gt;
  </code></pre>
  
  <hr>
  
  <p>thank you for your reply Chintana,... however I could not succeed it,... 
  I have a code that opens dialog box,... but I can't fit ajax call within:  </p>
  
  <pre><code>&lt;script&gt;
  $(function() {
  $( "#photo_comments_dialog_&lt;?php echo $photo_comment['PhotoComment']['id'] ?&gt;" ).dialog({
  autoOpen: false,
  width: 500,
  modal: true,
  title: 'Report Photo Comment'
  
  });
  
  $( "#photo_comments_opener_&lt;?php echo $photo_comment['PhotoComment']['id'] ?&gt;" ).click(function() {
    $( "#photo_comments_dialog_&lt;?php echo $photo_comment['PhotoComment']['id'] ?&gt;" ).dialog( "open" );
  });
  
  });
  &lt;/script&gt;
  </code></pre>
  
  <p>and here is the link: </p>
  
  <pre><code>&lt;?php echo $html-&gt;link(ucfirst(__('report', true)), 'javascript:void(0)', array('id' =&gt; "photo_comments_opener_".$photo_comment['PhotoComment']['id'], 'class' =&gt; 'report')) ?&gt;
  </code></pre>
  
  <p>and here is ID div:  </p>
  
  <pre><code>&lt;div id="photo_comments_dialog_&lt;?php echo $photo_comment['PhotoComment']['id'] ?&gt;"&gt;&lt;/div&gt;
  </code></pre>
  
  <p>please help me to accomplish this,... 
  thanks in advance </p>