I want to show preview of a form on clicking of preview button, so i'm just firing an ajax call (with post request) here to show the data in the fancybox. here is my code
$('#preview').click(function(e) {
e.preventDefault();
$.fancybox.showLoading();
$.post($(this).attr('href'), $('form').serialize(), function(res) {
$.fancybox(res, {
beforeShow : function() {
// do some thing
}
});
});
})
it is working fine, but need to show the ajax response in fancybox of type iframe in order to show it in proper design.
Thanks in advance.