Not able to Close the title of a Dialog with .dialog('close')
<p>Here is Code , when  .dialog('close') triggers only the content of dialog is closed and the title bar remains  on the page , Does any one have idea am I using the wrong way to close dialog box ?</p>

<pre><code>function popDialog(){

      if ($('#dialog').parents('.ui-dialog:visible').length) {
           $('#dialog').dialog('close');
      }

      $("#dialog").dialog({
           open: function(){ 
               $(this).load('/privacy.jsp');
           },
           title: 'A dynamically loaded dialog'
      });
}
</code></pre>

<p>This the Js fiddle for the example : <a href="http://jsfiddle.net/CW5wW/66/" rel="nofollow">http://jsfiddle.net/CW5wW/66/</a></p>

<hr>

<p>Sorry for  the confusion , its  my mistake , I was including the js files twice as i was including some other pages,  so I guess that caused the problem .</p>

<p>Thanks</p>
