I have a special requirement. I have a web page and when user press back button of the browser on the page, it should show a pop –up message. I tried the codes below but it is not working
window.onbeforeunload = function (evt) {
$.fancybox({
content: "<b>some text</B>",
padding: 0,
centerOnScroll: true,
overlayColor: "#000",
overlayOpacity: .7
});
};
This pop up is shown for a moment and taken to the back page itself.
My intension is to show a custom pop-up with 2 buttons and on clicking
on one of the button it should NOT GO the back page
and clicking on the other should go to the back page
is it possible to show such custom pop ups with custom actions?