title: Pass a variable to JQuery UI dialog
body: <p>I am deleting a record using PHP. I want to use a JQuery UI dialog to confirm the action, but I dont know how to pass a variable (my RecordID) to the redirect URL function, or allow the URL to access <code>window.location.href</code>.</p>
  
  <pre><code>$("#confirm" ).dialog({
  resizable: false,
  autoOpen: false,
  modal: true,
  buttons: {
      'OK': function() {
              window.location.href = 'url and myvar??';
          $( this ).dialog( "close" );
          },
      'Cancel': function() {
          $( this ).dialog( "close" );
          }
      }
  });
  
  
  $("#delete").click(function() {
      $("#confirm").dialog( "open" ).html ( "Are U Sure?" );
      return false;
  });
  </code></pre>
  
  <p>HTML</p>
  
  <pre><code>&lt;a href='index.php?recordid=$row[recordid]' id='delete'&gt;DELETE&lt;/a&gt;
  </code></pre>
  
  <p>Is there a good way to do this?</p>