The forums ran from 2008-2020 and are now closed and viewable here as an archive.

Home Forums JavaScript On window close run Bootstrap Popup

  • This topic is empty.
Viewing 2 posts - 1 through 2 (of 2 total)
  • Author
  • #184189

    Hi I wanna call this function before window close

    bootstrap pop

    Ilan Firsov

    You can’t really do this, but you can show a message to alert the user he has unsaved changes.
    Add a listener for the beforeUnload event and return a string value for a message (will not show on all browsers), when the user saves the changes remove the listener – you can’t just return null or false value, you must remove the listener

    A quick demo:

Viewing 2 posts - 1 through 2 (of 2 total)
  • The forum ‘JavaScript’ is closed to new topics and replies.