How to invoke bootbox.js after recording data in BD

Asked

Viewed 563 times

0

How can I show a message box using the bootbox.js after writing to the database redirecting the user?

I did a test with the following script, but did not succeed.

if($execCurso){ ?>
    <script>        
        $(document).on("load", ".alert", function(e) {
            bootbox.alert("Obrigado por se candidatar-se a essa vaga. Atualize seu currículo se achar necessário.", function() {
                var novaURL = "http://meuendereco/curriculo/Form.php";
                $(window.document.location).attr('href',novaURL);                           
            });
        });         
    </script>

<?php   
}else{
    echo "Erro cadastrando";
    header("Location:home.php?m=0");
}

I made some queries by Google but I could not find the solution to the problem I have.

1 answer

2


Instead of: $(window.document.location).attr('href',novaURL); trial location.href=novaURL. It’s always worked for me.

  • Hello user3511079 the problem is that I am not able to show the message.

  • @adventistapr In place of $(document).on("load", ".alert", function(e) { trial $(document).load(function(){

  • Thanks @Natanael Lopes, big help.

Browser other questions tagged

You are not signed in. Login or sign up in order to post.