views:

108

answers:

1

The following works in current Firefox (PDF loads), but not in current IE (page is blank). Any suggestions?

<head>
    <script type="text/javascript">
        function startup() {
            var bubba = document.getElementById('bubba');
            bubba.data = 'http://server.qa/test.pdf';
        }
    </script>
</head>
<body onload="startup();">
    <object id="bubba" type="application/pdf" width="80%" height="800">
      No PDF reader installed
    </object>
</body>
+1  A: 

You won't be able to display the PDF like that. The syntax for including plugins differs between IE and Forefox.

I would recommend using an <iframe> instead of an <object> and using JavaScript to set the iframe's src attribute. This should invoke whichever PDF plugin is installed in the browser, or download the PDF if none is.

Josh