I suspect your problem is that your fbfullpostviewpage page is not part of the DOM
at the point at which your are binding your event. What you should do in this case is to use event delegation
instead of trying to directly bind to the page element.
Basically with event delegation what you do is bind the event to a higher level DOM
element (all the way up to the Document
if necessary, but you should generally try and bind it as close to the target selector as possible) that does exist at that time, and then when the event bubbles up the DOM
check to see if the event matches a certain selector.
In addition to allowing you to bind events for dynamically inserted elements, event delegation is also usually more efficient since you can reduce the number of events that are bound.
For example you can use the jQuery .on function like the following
$(document).on('pagehide', '#fbfullpostviewpage', function() {
alert('Dialog closed');
});