Reload a jQuery Dialog after close
<p>How can I reload a jQuery opened dialog? The id I'm taking to open the dialog is a button! After a web service call from php, I am not able to change the contents of the table in the dialog without reloading the page. 
Here is the code:</p>

<pre><code>    ?&gt;
   &lt;script type="text/javascript"&gt;
       jQuery.noConflict();
  jQuery(function() {
    jQuery("#taxInfo").dialog({
                autoOpen : false,
                height : 380,
                width : 550,
                modal : true,
                show : {
                    effect : "slide",
                    duration : 250
                },
                hide : {
                    effect : "slide",
                    duration : 250
                },

                close : function() {

                                        jQuery("#taxInfo").dialog("close");
                                       // jQuery("#taxInfo").find('#btnclick')[0].reset();
                                       jQuery("#t01").html("");
                }
            });
  });

jQuery(function() {
jQuery('#btnclick').click(function() {
 //   alert('Clicked');
  var self = jQuery( this );

        var loaderContainer = jQuery( '&lt;span/&gt;', {
            'class': 'loader-image-container'
        }).insertAfter( self );

        var loader = jQuery( '&lt;img/&gt;', {
            src:  '../wp-admin/images/loading.gif',
            'class': 'loader-image'
        }).appendTo( loaderContainer );

    &lt;?php

//php call here

?&gt;
     var formattedString="";
            /* sending the request*/
            jQuery.ajax({
            url:'&lt;?php echo$retailerSettings["taxengine_url"]. "/calculate_tax"?&gt;',
            data: '&lt;?php echo  $_SESSION["jsonTax"];?&gt;',
            dataType:'json',
            contentType:'application/json',
            mimeType: 'application/json',
            crossDomain:true,
            timeout:10000,
            async: false,
            cache: false,
            type:'POST',
            success:function(data){

                    var fipsRegionNames=data.fipsCode;
                    var fipsCode=data.fipsRegionNames;
                    var fipsRate=data.fipsRate;


            //    fipsRegionNames = fipsRegionNames.replace(",", ", ");
        //        fipsCode = fipsCode.replace(",", ", ");
        //        fipsRate = fipsRate.replace(",", ", ");
                loaderContainer.remove();
                                if(fipsCode==undefined)
                                {
                                 formattedString=formattedString.concat("&lt;div&gt;Tax information not found&lt;/div&gt;");   
                                } else {
                  var  value = fipsRegionNames.split(",");
                 var name = fipsCode.split(",");
                  var rate = fipsRate.split(",");
                  formattedString=formattedString.concat("&lt;table border='1' id='t01'");
                  formattedString=formattedString.concat("&lt;tr&gt;");
                  formattedString=formattedString.concat("&lt;td style='padding:8px;!important;'&gt;");
                  formattedString=formattedString.concat("Type");
                  formattedString=formattedString.concat("&lt;/td&gt;");
                  formattedString=formattedString.concat("&lt;td style='padding:8px;!important;'&gt;");
                  formattedString=formattedString.concat("Name");
                  formattedString=formattedString.concat("&lt;/td&gt;");
                  formattedString=formattedString.concat("&lt;td style='padding:8px;!important;'&gt;");
                  formattedString=formattedString.concat("FipsCode");
                  formattedString=formattedString.concat("&lt;/td&gt;");
                  formattedString=formattedString.concat("&lt;td style='padding:8px;!important;'&gt;");
                  formattedString=formattedString.concat("Rate");
                  formattedString=formattedString.concat("&lt;/td&gt;");
                  formattedString=formattedString.concat("&lt;/tr&gt;");
                  for (var i=0;i&lt;fipsRegionNames.length;i++)
                  {
                   formattedString=formattedString.concat("&lt;tr&gt;");
                   if (i == 0)
                   {
                    formattedString=formattedString.concat("&lt;td style='padding:8px;!important;'&gt;");
                    formattedString=formattedString.concat("State");
                    formattedString=formattedString.concat("&lt;/td&gt;");
                   }
                   else if (i == 1)
                   {
                    formattedString=formattedString.concat("&lt;td style='padding:8px;!important;'&gt;");
                    formattedString=formattedString.concat("County");
                    formattedString=formattedString.concat("&lt;/td&gt;");
                   }
                   else if (i == 2)
                   {
                    formattedString=formattedString.concat("&lt;td style='padding:8px;!important;'&gt;");
                    formattedString=formattedString.concat("Place");
                    formattedString=formattedString.concat("&lt;/td&gt;");
                   }
                   else if (i == 3)
                   {
                    formattedString=formattedString.concat("&lt;td style='padding:8px;!important;'&gt;");
                    formattedString=formattedString.concat("Special Taxing Districts");
                    formattedString=formattedString.concat("&lt;/td&gt;");

                   }
                    if(name[i]==undefined)
                    {

                    }
                    else
                    {
                            formattedString=formattedString.concat("&lt;td style='padding:8px;!important;'&gt;");
                            formattedString=formattedString.concat(name[i]);

                            formattedString=formattedString.concat("&lt;/td&gt;");
                             formattedString=formattedString.concat(" ");
                    }

                  if(value[i]==undefined)
                  {

                  }
                  else
                  {
                     formattedString=formattedString.concat("&lt;td style='padding:8px;!important;'&gt;");
                            formattedString=formattedString.concat(value[i]);

                            formattedString=formattedString.concat("&lt;/td&gt;");
                             formattedString=formattedString.concat(" ");
                  }
                if(rate[i]==undefined)
                {

                }
                else
                {
                    formattedString=formattedString.concat("&lt;td style='padding:8px;!important;'&gt;");

                      formattedString=formattedString.concat(rate[i]);

                   formattedString=formattedString.concat("&lt;/td&gt;");
                }

                   //        formattedString=formattedString.concat("&lt;br/&gt;");
                   formattedString=formattedString.concat("&lt;/tr&gt;");

                 } 
           formattedString=formattedString.concat("&lt;/table&gt;");
   }
        if(data.isException=="true" || data.isException==true)
        {
            //formattedString=formattedString.concat(data.message);
        }

   jQuery("#taxInfo").html(formattedString);
                },

                    error:function(XMLHttpRequest,textStatus, errorThrown) {

                      } 
             });

                         // window.location.reload(false);
            jQuery("#taxInfo").dialog("open");


});
})


&lt;/script&gt;
</code></pre>

<p>Thanks!</p>