1

I'm trying to add an event listener to an embed object but still not success, this is the piece of bits I'm trying now.

var obj,
    url = "http://www.google.com",
    container = document.getElementById("contractFrameContainer");

obj = document.createElement('embed');
obj.setAttribute("type", "application/pdf");
obj.setAttribute("id", "pdf1");
obj.style.width = '100%';
obj.height = heightBody;
obj.setAttribute("src", url);       
obj.addEventListener("load", pdfLoad, false);

function pdfLoad() {
    // do something...
}

container.appendChild(obj);

PD: I'm using IE 11

Brian Tompsett - 汤莱恩
  • 5,753
  • 72
  • 57
  • 129
martinezjc
  • 3,415
  • 3
  • 21
  • 29

0 Answers0