TypeError:无法读取未定义javascript的属性'then'

问题描述 投票:-3回答:1

当警报正常时,我试图将我带到inicioSesion.php页面,但我不知道会发生什么错误,这是为什么呢?

<script>
    swal("Borrado!", "El sanitario ha sido borrado!", "success").then(redirigir => {
        if (redirigir) {
            window.location.href = "inicioSesion.php";
        }
    });
</script>
javascript php
1个回答
0
投票

您没有PHP或Javascript问题/疑问。您的问题是有关Java插件中的一些配置/使用。

您正在使用此:https://github.com/sweetalert2/sweetalert2

检查此:https://sweetalert2.github.io/

然后,如果在实现上遇到问题,请在https://github.com/sweetalert2/sweetalert2/issues中进行搜索,如果之前发生过,请>

© www.soinside.com 2019 - 2024. All rights reserved.