如何解决SweetAlert2 似乎对我不起作用我做错了什么?
Here is the link to a simple source code example .我不知道我做错了什么,我按下按钮时似乎得到了回复,我可以通过通知代码证明这一点。
<!DOCTYPE html>
<html lang="en">
<head>
<Meta charset="UTF-8">
<Meta http-equiv="X-UA-Compatible" content="IE=edge">
<Meta name="viewport" content="width=device-width,initial-scale=1.0">
<title>Document</title>
<link rel="stylesheet" type="text/css" href="https://unpkg.com/notie/dist/notie.min.css">
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/limonte-sweetalert2/10.16.6/sweetalert2.css">
</head>
<body>
<div class="container">
<div class="row">
<div class="col">
<div><input type="submit" id="swale" class="btn btn-outline-danger" value="Make Registration"></div>
</div>
</div>
</div>
<script src="https://unpkg.com/notie"></script>
<script src="//cdn.jsdelivr.net/npm/sweetalert2@11"></script>
<script>
document.getElementById("swale").addEventListener("click",function(){
notify("This is a success message","success")
notifyModal()
})
function notify(msg,msgType){
notie.alert({
type: msgType,text: msg,})
}
function notifyModal(){
swal.fire({
title: "title",html: "<em> hello,world </em>",icon: "success",confirmButtonText: "wsd"
})
}
</script>
</body>
</html>
解决方法
你必须在脑海中调用stylesweetalert2
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/limonte-sweetalert2/10.16.6/sweetalert2.css">
版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 dio@foxmail.com 举报,一经查实,本站将立刻删除。