What should be done to avoid a server request for the pdf? I have tried visibility=hidden and width=0.
<object class='pdfClass' data='"+conventionId+"/showPdf.html' width='100%' height='600'></object>
function toggleConv() {
if (...) {
document.getElementById(conventionId).style.display = 'none';
} else {
document.getElementById(conventionId).style.display = ''; //causes a refresh
}
}
EDIT:
After testing, I found out that the following works in Firefox 13 without reloading:
http://jsfiddle.net/userdude/KnEYC/2/
Original response. Note that the
heightandwidthof the element also need to be toggled down to little or nothing to prevent it continuing to taking up the same space.One technique would be to hide it from view by placing it way off screen:
http://jsfiddle.net/userdude/KnEYC/