Question

How to get rid of web browser default prompt? My coffescript below. enter image description here

$(window).on 'beforeunload', (e) ->
    e.preventDefault()
    question = "<h4 class='text-center'>The actual changes for black/white list will be lost.</h4>"
    bootbox.confirm question, (result) ->
        if result
            $.post url, () ->
                window.location.reload()
Was it helpful?

Solution

You cannot replace the inbuilt message boxes. All you can do is use a plugin (or write your own logic) which replaces their functionality with HTML elements which can be styled.

This will mean changing your javascript code where alert, confirm etc are used.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top