title: How to refresh content loaded inside fancybox with ajax submit
body: <p>I have some form that I'm loading inside a Fancybox. When I submit this with ajax, and I get success, I want to reload this same page, inside this Fancybox window, but i don't know how.</p>
  
  <p>I already have tried <code>$.fancybox.update()</code> but didn't work. I'm using Fancybox 2. </p>
  
  <p>Can anyone help?</p>
  
  <p>Here is my code:</p>
  
  <p>on parent page:</p>
  
  <pre><code>&lt;script type="text/javascript" charset="utf-8"&gt;
      $("a.open-modal").fancybox({type: 'ajax'});
  &lt;/script&gt;
  
  &lt;a class="open-modal" href="edita_cadastro_imagens.asp?codProd=&lt;%= rs_Pesq("codProd")%&gt;&amp;codCor=&lt;%= rs_Pesq("codCor")%&gt;&lt;%=str_pesq%&gt;&amp;ref=&lt;%= rs_Pesq("referencia")%&gt;"&gt;&lt;i class="fa fa-camera fa-lg"&gt;&lt;/i&gt;&lt;/a&gt;
  </code></pre>
  
  <p>Here is the code of the page: <code>edita_cadastro_imagens.asp</code></p>
  
  <p>my Ajax code:</p>
  
  <pre><code>&lt;script type="text/javascript"&gt;
  
      $(document).on('submit', '#f1', function(event) {
  
          event.preventDefault();
  
          var formData = new FormData($(this)[0]);
          console.log(formData);
  
          $.ajax({
              url: "upload_produtos.asp?cod_prod=&lt;%=codProd%&gt;&amp;cod_cor=&lt;%=codCor%&gt;&amp;Num_Img=1",
              type: "POST",
              data: formData,
              async: false,
              cache: false,
              contentType: false,
              processData: false,
              success: function(data){
                  if (data == "erro") {
                      alert("erro")
                  } else {
                      //$.fancybox.close();
                      $.fancybox.update();
                  }
              }
          });
  
      });
  
  &lt;/script&gt;
  </code></pre>
  
  <p>and my form:</p>
  
  <pre><code>&lt;form name="f1" id="f1" action="" method="post" enctype="multipart/form-data"&gt;
                  &lt;div class="div_coluna col_image"&gt;
                      &lt;% if objFSO.FileExists(Server.MapPath("../produtos/mini") &amp; "/"&amp; codProd&amp;"_"&amp;codCor&amp;" (1).jpg") then %&gt;
                          &lt;img src="../produtos/mini/&lt;%= codProd%&gt;_&lt;%= codCor%&gt; (1).jpg" border="0"/&gt;
                      &lt;% else %&gt;
                          &lt;img src= "imagens/imgNDisp.png" border="0"  height="49px" width="70px"/&gt;
                      &lt;% end if %&gt;
                  &lt;/div&gt;
                  &lt;div class="div_coluna col_field"&gt;
                      &lt;input type="file" name="txtArquivo1" accept="image/jpg" class="small_form_control" style="width:90%"&gt;
                  &lt;/div&gt;
                  &lt;div class="div_coluna col_bt"&gt;
                      &lt;button class="button"&gt;ENVIAR&lt;/button&gt;
                  &lt;/div&gt;
                  &lt;div class="clear"&gt;&lt;/div&gt;
              &lt;/form&gt;
  </code></pre>