Search code examples
angular-ui-bootstrapbootbox

bootbox alert gets faded if after alert window reload is done


The bootstrap bootbox alert gets faded if window reload is done as in the below mentioned code. If any one knows the solution please help.

bootbox.alert("Successfully created shipment. \n Transaction Hash is:" + data) window.location.reload();


Solution

  • This is covered in multiple places in the documentation. To reiterate: Your location.reload call needs to be in the callback:

    bootbox.alert("Successfully created shipment. \n Transaction Hash is:" + data, function(){ window.location.reload(); });
    

    or

    bootbox.alert({
        message: "Successfully created shipment. \n Transaction Hash is:" + data),
        callback: function(){ 
            window.location.reload();
        }
    });