Comments (4)
I was using this: https://cdn.jsdelivr.net/npm/[email protected]/dist/sweetalert2.all.min.js
per the install instructions found on https://sweetalert2.github.io/. See download & install section. It says, "Or grab from jsDelivr CDN". If you follow that, you see:
I'm sorry, I don't know the difference yet between sweetalert2.js and sweetalert2.all.js
I guess that's what you're saying when you say the all has the styles built in. The regular js needs the styles deployed separately.
I'm sorry for burning your time on that. I see that is described in the documentation. Just didn't catch it and wasn't clear to me.
Thank you for your help,
Tony
from sweetalert2.github.io.
The library is shipped in both styled and unstyled variants.
The unstyled one isn't using inline styles, here's how to use it:
import Swal from 'sweetalert2/dist/sweetalert2.js'
And of course you'd need to include Swal styles separately for example using the link
tag:
<link rel="stylesheet" href="sweetalert2.min.css">
or by including it in your styles:
import 'sweetalert2/src/sweetalert2.scss'
Read more: https://sweetalert2.github.io/#usage
from sweetalert2.github.io.
Perhaps this is not the place for this conversation, but the latest code does still fail. The second line shown here (which is from the minified .js) fails at appendChild. And line 7 as well. I'm sure I may be doing something wrong and have missed a step, but I don't think so. I ran into this while upgrading sweetalert2. A previous version does not exhibit this problem. v11.7.32
var n = e.createElement("style");
if (e.getElementsByTagName("head")[0].appendChild(n),
n.styleSheet)
n.styleSheet.disabled || (n.styleSheet.cssText = t);
else
try {
n.innerHTML = t
} catch (e) {
n.innerText = t
}
from sweetalert2.github.io.
v11.10.6
doesn't have any e.createElement("style")
:
https://cdn.jsdelivr.net/npm/[email protected]/dist/sweetalert2.js
double-check that you're importing from sweetalert2/dist/sweetalert2.js
from sweetalert2.github.io.
Related Issues (20)
- Add Google Maps recipe
- Improve login form recipe to submit itself with Enter
- Add the custom icon (html + position) recipe
- Add Bootstrap 4 + SweetAlert2 recipe HOT 1
- Add flatpickr recipe HOT 1
- Add DnD recipe
- Add pdf viewer example with fullscreen support
- Document new hooks, deprecate old ones HOT 1
- Add the right-side drawer recipe HOT 2
- Unexpected gap in the "long content" example in iOS HOT 1
- Document returnInputValueOnDeny HOT 1
- Add docs for declarative templates (the `template` param) HOT 1
- Rtl support HOT 1
- Low contrast issues HOT 2
- add getPopup() method
- Dependency Dashboard
- The script for installing Sweetalert is not working
- [DOC] Point out that only animation is supported HOT 2
- Sidebar fails after a few clicks HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from sweetalert2.github.io.