title: open jquery dialog from php redirect error
body: <p>I am having trouble opening a jquery window from a redirect after a database update. When the page redirects, I have coded so that I can get the value and open window based on that value. Example below.</p>
  
  <pre><code>header("Location: http://localhost/sample/users/cp.php?dialog=1");
  exit();
  </code></pre>
  
  <p>In cp.php I have the following code which does not trigger window. If however, I change autoOpen:true, the the window loads on page load. I would be grateful if someone could point out my error. Thanks</p>
  
  <p>cp.php</p>
  
  <pre><code>&lt;?php
  $dialog = $_GET['dialog'];
  if ($dialog ==1)
          {
             echo '&lt;script type="text/javascript"&gt; dialog(); &lt;/script&gt;';
          }
  
  ?&gt;
  &lt;script src="js/jquery-1.3.2.min.js"&gt;&lt;/script&gt;
  &lt;script src="js/ui.dialog.js" type="text/javascript"&gt;&lt;/script&gt;
  &lt;link href="css/redmond/jquery-ui-1.7.3.custom.css" rel="stylesheet" type="text/css" media="all" /&gt;
  
  &lt;script type="text/javascript"&gt;
    function dialog() {
      $(function() {
          $( "#response1" ).dialog({
              modal: true,
              autoOpen: false,
              buttons: {
                  Ok: function() {
                      $( this ).dialog( "close" );
                  }
              }
          });
  
  
      });
    }
      &lt;/script&gt;
  
  
   &lt;div style="display:none" id="response1" title="Successfully updated destroy date"&gt;
      &lt;p&gt;
          &lt;span class="ui-icon ui-icon-circle-check" style="float: left; margin: 0 7px 50px 0;"&gt;&lt;/span&gt;
          You have successfully updated your destroy date. You may now close this window. Thank you.
      &lt;/p&gt;
  
  &lt;/div&gt;
  </code></pre>