+ 6

WHY DOESN'T SWAL WORK[SOLVED]

I don't know why but swal doesn't work for me😥 First time trying swal(sweet alert) Please tell me what I am doing wrong https://code.sololearn.com/W4OkC7R20W99/?ref=app

5th Nov 2020, 8:11 PM
Atoms~⚛
Atoms~⚛ - avatar
8 Antworten
+ 7
Atomic Wave ~⚛ Your code logs an error message of "swal" is not defined because you have put the script tag in body, so it is not loaded before the code in JS tab runs. Then, because your swal() is in DOMContentLoad event listener, instead of window load event listener, so swal() runs before the library is imported. ααdítчα ❣️ Your demo works. Just one more point to note: The url from SweetAlert Documentation is a generic one without version, so when they change the syntax later, the code may crash, so it is better to specify the version to import. The url to import a specific version is actually in the sentence above the url textbox, here is my video explaining SweetAlert for your reference: https://youtu.be/ZKj0QrrQ6fw We can customize the buttons, read the button clicked, add textbox to modal box, use image as icon, and style the SweetAlert Modal Box, I have introduced ways in my above video, hope it helps.
6th Nov 2020, 4:17 PM
Gordon
Gordon - avatar
+ 4
@aadiyta What did you change???
7th Nov 2020, 5:21 PM
Galaxy-Coding (inactive)
Galaxy-Coding (inactive) - avatar
+ 3
Remove java script ;-;
5th Nov 2020, 8:18 PM
Operand
Operand - avatar
+ 3
ααdítчα ❣️ but both are same... And the output is not same.. !?!?!?!?!? I did not mean that you have copied... I m saying that both codes are same and output it different..
6th Nov 2020, 5:23 AM
ANDY тнє CODER [RECODE]
ANDY тнє CODER [RECODE] - avatar
7th Nov 2020, 5:18 PM
Galaxy-Coding (inactive)
Galaxy-Coding (inactive) - avatar
+ 2
I think there might be a problem with the COMPILER because both codes , from ααdítчα ❣️ and Atomic Wave ~⚛ are same.. If you face such problems , you can connect to SL via Discord or any other social platform...
6th Nov 2020, 3:11 AM
ANDY тнє CODER [RECODE]
ANDY тнє CODER [RECODE] - avatar
0
YOU ARE STUPID
12th May 2021, 10:40 PM
DrNefardio
DrNefardio - avatar