Cannot embed .doc,docx files in google doc viewer
<p>I have my code to embed files in page and open in Google Docs Viewer. but so far I get "No preview available" when i want to open .doc or docx files but opens correctly when I open PDF files.
And again instead of opening the file in Google Docs I'm prompted to download the file instead of viewing it on the browser.</p>

<p>Here is my code:</p>

<pre><code>&lt;a href="sample.doc"  class="embed"&gt;&lt;h2&gt;sample.doc&lt;/h2&gt;&lt;button &gt;view document&lt;/button&gt;&lt;/a&gt;
&lt;script&gt;
    $(document).ready(function() {
      $('a.embed').gdocsViewer({width:740,height:742});
      $('#embedURL').gdocsViewer();
    });
&lt;/script&gt;
</code></pre>

<p>And here is my jQuery plugin:</p>

<pre><code>(function($){
    $.fn.gdocsViewer = function(options) {

        var settings = {
            width  : '600',
            height : '700'
        };

        if (options) { 
            $.extend(settings, options);
        }

        return this.each(function() {
            var file = $(this).attr('href');
            var ext = file.substring(file.lastIndexOf('.') + 1);

            if (/^(tiff|doc|ppt|pps|pdf|docx)$/.test(ext)) {
                $(this).after(function () {
                    var id = $(this).attr('id');
                    var gdvId = (typeof id !== 'undefined' &amp;&amp; id !== false) ? id + '-gdocsviewer' : '';
                    return '&lt;div id="' + gdvId + '" class="gdocsviewer"&gt;&lt;iframe src="http://docs.google.com/viewer?embedded=true&amp;url=' + encodeURIComponent(file) + '" width="' + settings.width + '" height="' + settings.height + '" style="border: none;margin : 0 auto; display : block;"&gt;&lt;/iframe&gt;&lt;/div&gt;';
                })
            }
        });
    };})( jQuery );
</code></pre>