Skip to content


Subversion checkout URL

You can clone with
Download ZIP


IE requests document twice #3

panzuriel opened this Issue · 2 comments

2 participants



IE (6 and 8 I've tested) sends two requests for the pdf. The suggested solution:

<OBJECT CLASSID="clsid:CA8A9780-280D-11CF-A24D-444553540000" STYLE="height:100%; width: 100%" >
   <PARAM NAME="src" VALUE="http://server/path/filename.pdf">

doesn't work in other browsers (Chrome, Firefox), so you need to do browser detection, so I've done this:

        if (navigator.appName == 'Microsoft Internet Explorer') {
            targetNode.innerHTML = '<object CLASSID="clsid:CA8A9780-280D-11CF-A24D-444553540000" width="' +width +'" height="' +height +'"><param name="src" value="' +url +'"></object>';
        } else {
            targetNode.innerHTML = '<object data="' +url +'" type="application/pdf" width="' +width +'" height="' +height +'"></object>';

That's a very interesting link, thanks for passing it along. More proof IE is a pain to deal with.

So the question becomes "what's more important: reducing GET requests, or producing a streamlined utility that produces standards-compliant markup?"

Implementing your fix -- which is very similar to SWFObject's inner workings -- adds complexity to the codebase (I admit it isn't too bad), and produces non-standard code. What makes it even trickier is that IE 10 is supposed to behave the same as non-IE browsers, which means the classid addition might possibly fail or at the very least be unnecessary.


Thanks again.


Thanks, it's been a few years since this case was opened. Now that Microsoft is clearly moving away from ActiveX and proprietary code (attempting to make their latest browsers behave more like Chrome/Firefox/Webkit), I will aim to avoid any IE-specific cod where I can.

@pipwerks pipwerks closed this
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.