Search code examples
jqueryfancybox

How to display a word document using fancybox


HTML code

<div class='case'>
    <a href="http://localhost/DXXX/case/reqirement.doc" rel="case"> view</a>
</div>

Jquery code

$(".case").live('click', function(){
    $.fancybox({
        openEffect: 'elastic',
        closeEffect: 'elastic'
    });
});

it's displays the requested content cannot be loaded please try again later.... And I get a download of that document file... How can I display the document file using fancybox


Solution

  • You can't. Browsers don't have any built-in way to view Word docs so unless the user has configured their browser to open it with some plugin (which 99% of the world hasn't done), the browser will prompt them to download the file.