PDFObject: How to reload container with a different copy of the same file?
<p>I have a button that generates a PDF, then reloads the PDF in the browser by replacing the container it's in with itself, but with a different link. For some reason, the new PDF doesn't show up, the old one is there still no matter how many times it is refreshed. I'm not using an iframe or an object/embed method, I'm using <a href="http://pdfobject.com/" rel="nofollow">http://pdfobject.com/</a></p>

<p>My html pdfobject container:</p>

<pre><code>&lt;div id="pdfContainer"&gt;
    &lt;div id="pdfSample"&gt;&lt;/div&gt;
&lt;/div&gt;
</code></pre>

<p>My Javascript to initiate the src upon window load:</p>

<pre><code>&lt;script type="text/javascript"&gt;
    $(function () {
        PDFObject.embed("myInitialPDF.pdf", "#pdfSample");
    })
&lt;/script&gt;
</code></pre>

<p>My AJAX call to the PDF-creation/container-refresh:</p>

<pre><code>$('#genPDF').click(function () {
    $.ajax({
        url: "mergePDF.php",
        data: str,
        cache: false,
        success: function (result) {
            $("#pdfobject").attr("src", "newPDF.pdf");
            var container = document.getElementById("pdfContainer");
            var content = container.innerHTML;
            container.innerHTML = content;
        }
    });
});
</code></pre>

<p>Everytime the button with ID genPDF is clicked, a new PDF is generated by the name "newPDF.pdf" and the container should replace the previously assigned src path with the new source path of the new PDF (which is the same name as before). I don't understand if it's cache that's preventing this or not. Am I missing something?</p>