简体   繁体   English

SweetAlert2 似乎对我不起作用。 我做错了什么?

[英]SweetAlert2 doesn't seem to work for me . What have i done wrong?

Here is the link to a simple source code example . 这是一个简单源代码示例的链接 I don't know what have I done wrong, I seem to get a reply when i press the button and i can prove it because of notie code.我不知道我做错了什么,当我按下按钮时我似乎得到了回复,我可以证明它是因为通知代码。

Here is a minimal reproducible code这是一个最小的可重现代码

 <,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>

you have to call styles sweetalert2 in your head您必须在脑海中致电 styles sweetalert2

<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/limonte-sweetalert2/10.16.6/sweetalert2.css">

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM