<object> onload not firing in Chrome

Loading a PDF in an <object> tag, I want to show an indicator while the document is being loaded instead of just an empty element, so I positioned a Load Panel over the <object>. I added a function to hide the panel:

function documentLoaded() {
    // Code to hide panel here.

And set it to fire in the onload event of the <object> tag:

<object type="application/pdf" data="/documents/sample.pdf" onload="documentLoaded();"></object>

This is working exactly how I want it to in Firefox and in Edge, but when I tested it in Chrome the Load Panel never went away. When I debugged it I saw that the documentLoaded() function was never called at any point.

Is there another way to get this to work with Chrome, or another way completely to call a JS function once the PDF is ready?

43 thoughts on “<object> onload not firing in Chrome”

  1. 133422 254017 I discovered your weblog web site on google and check a couple of of your early posts. Continue to maintain up the extremely very good operate. I just additional up your RSS feed to my MSN News Reader. Seeking forward to reading far more from you later on! 842939


Leave a Comment