title: Uncaught Error: cannot call methods on dialog prior to initialization; attempted to call method 'option'
body: <p>I'm trying to use the jQuery UI Dialog to provide a small pop-up that brings some information about a customer and shows a form. Everything works fine, except that it only works for the first click. If I try to click the same button again, or another one I get the error message:</p>
  
  <pre><code>Uncaught Error: cannot call methods on dialog prior to initialization; attempted to call method 'option'
  </code></pre>
  
  <p>I've managed to figure out it has to do with the closing/destroying of the dialog, but I don't understand what I'm doing wrong. If I comment the part <code>$(this).dialog('destroy');</code> then at least the dialog works but I get a different error</p>
  
  <pre><code>Uncaught TypeError: Object Exclude something has no method 'dialog'
  </code></pre>
  
  <p>I've tried with jQuery 1.8.3/1.9.1 with jquery-ui-1.9.2 and I get the same problem.</p>
  
  <p>This is what I have set up: <a href="http://jsfiddle.net/ycZpQ/" rel="nofollow">http://jsfiddle.net/ycZpQ/</a></p>