2

I'm loading a .pdf file in a pop up window. I want to attach an event. The ready event works perfectly fine, but the other events do not. Why is this?

This works:

var destURL = "c:\mypdf.pdf;
$(window.open(destURL)).ready(handler);

This does not:

var destURL = "c:\mypdf.pdf;
$(window.open(destURL)).unload(handler);

At first I was thinking you cannot add jquery to a page that is really just a pdf document, but the fact that .ready is working makes me think otherwise. None of the other events work either, just .ready.

carlg
  • 1,802
  • 4
  • 25
  • 39

1 Answers1

0

It doesn't look like this is possible, at least not cross browser. In FF using pdf.js for example the unload handler is called, but immediately after the window loads.

is it possible to open a popup with javascript and then detect when the user closes it? has a useable answer using polling.

Community
  • 1
  • 1
Jasper Krijgsman
  • 1,018
  • 11
  • 13