title: Post preview - Passing data with AJAX and Fancybox
body: <p>I'm trying to do a post preview, which will appears in a new Fancybox iframe. Since couple of weeks I'm looking for some help or best practices, but I can't find it.</p>
  
  <p>My main problem is to pass the data from form (before updating database) to Fancybox window. My AJAX skills are very poor, so maybe my problem isn't so hard.</p>
  
  <p>Please check the code:</p>
  
  <pre><code>$('.preview2').fancybox({
  fitToView    : false,
  width        : 905,
  height        : 505,
  autoSize    : false,
  closeClick    : false,
  openEffect    : 'none',
  closeEffect    : 'none',
  ajax: {
      type: "POST",
      cache : false,
      url: "preview.php",
      data: $('#postp').serialize()
  }
  });
  </code></pre>
  
  <p>And a calling link:</p>
  
  <pre><code>&lt;a class="preview2" data-fancybox-type="iframe" href="preview.php" id="preview2"&gt;Preview&lt;/a&gt;
  </code></pre>
  
  <p>I'm almost sure everything is fine with preview.php file, just posting the variables and printing it in right places.</p>
  
  <p>Can someone check Fancybox / AJAX part?</p>