Forums

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
    Posts
  • #184189
    Shahjehan
    Participant

    Hi I wanna call this function before window close

    bootstrap pop

    #184890
    Ilan Firsov
    Participant

    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:
    http://codepen.io/ilanfir/pen/Jjlky

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