Is it possible to determine if a dialog window (JavaScript window.open) is closed by a user? We are trying to determine if a user has shared a Tweet by clicking the Tweet button in the dialog window and since we can't get verification from Twitter, the next best option seems to be to determine if the user has closed the dialog window by clicking the X. This is a .Net MVC4 application.
Asked
Active
Viewed 46 times
0
-
you could do a wire up to that X button where when clicked on, do a POST via AJAX to your MVC Action or web method of some kind to indicate the user pressed the X on the modal dialog. Simply then pass in the parameters you need to the web method/action that you need – Ahmed ilyas Jun 28 '14 at 12:00
-
you now added how you are displaying this window dialog. you are now saying you are using window.open in which case: http://stackoverflow.com/questions/3291712/is-it-possible-to-open-a-popup-with-javascript-and-then-detect-when-the-user-clo – Ahmed ilyas Jun 28 '14 at 12:01
-
but how to determine if the window is closed because of clicking the X vs closed because the user clicks the Tweet button? – radiusx2 Jun 28 '14 at 12:09
-
I think we will just disable the close using the X button and add our own Close button which will then enable us to control what happens when the Close button is clicked. – radiusx2 Jun 28 '14 at 13:27