title: Jqueryui dialog("close") ends current javascript thread
body: <p>Hi I am having an issue with closing my jquery dialog.
  What I have is a comet connection that sends messages to my browser. What I would like to do is when I receive a message I want to do some stuff, close the dialog then do some more stuff. Unfortunately when I execute: $('#dialog').dialog("close"); It ends my current javascript code. Is there a way to avoid this? or do I need to make sure the close is run right at the end using a variable?</p>
  
  <p>For example, here you can see that my text will not change when it is after:
  <a href="http://jsfiddle.net/hKhMC/" rel="nofollow">http://jsfiddle.net/hKhMC/</a></p>
  
  <p>This is a simple demonstration my actual code does a lot of calculations afterwards so I was wondering if there was a solution that doesn't involve moving the text before the close.</p>