title: jQuery Modal popup dialog ok button click event
body: <p>I am trying to open dialog box and passing OK callback function in helper function. So on click of Ok button that function will execute.
  But problem is, callback function getting executed at the time of dialog function call. Below is my code.</p>
  
  <pre><code>  function ModelMessage(message, title, messageType, okButtonText, okCallBack) { 
  $("#dialog-confirm").dialog({
          resizable: false,
          height: 200,
          modal: true,
          open: function (event, ui) {            
              $('.ui-button-text').each(function (i) {
                  $(this).html($(this).parent().attr('text'));
              });                
          },
          buttons: [{
              text: "Ok",
              id : "btnModalDialog",
              Click : function () {                    
                  okCallBack();                   
                  $("#dialog-confirm").dialog("close");
              }
          }]
      });
  </code></pre>
  
  <p>Below is the code from where I am calling this helper function:</p>
  
  <pre><code>ModelMessage(ProjectSaveSuccess, null, null, "Ok", function () {
                                  window.location.href = url_CreateProject + "?projectID=" + PID.val();
                              });
  </code></pre>
  
  <p>I am using jquery-1.9.1.js and jquery-ui.js(1.9.1). <strong>This issue is not replicate in older version of jquery.</strong>  Is this jquery known bug?</p>