I am using the following function:
function pdfChanger(location){
document.getElementById("pdf").setAttribute("data",location);
}
which is called here:
<a href="javascript:pdfChanger('documents/SecurityDocs/sample.pdf')">test1</a><br/>
and is designed to change the pdf file displayed in this object:
<object id="pdf" data="documents/sample2.pdf#toolbar=0&navpanes=0&scrollbar=0&page=1&view=FitHtop"
type="application/pdf"></object>
In firefox clicking on the link which evokes this function changes the pdf object correctly. In chrome, however, you have to click on the pdf after you have clicked the link, in order to correctly display the changed pdf. In IE the pdf does not change at all. Why is this happening and what can I do to make this function work uniformly in all browsers?