We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent fd4a0bd commit d632f47Copy full SHA for d632f47
README.md
@@ -76,14 +76,21 @@ toast.push('Hello world!')
76
Or if you prefer to go old-school javascript and a CDN:
77
78
```html
79
-<html>
80
<head>
81
...
82
- <script defer src="https://cdn.jsdelivr.net/npm/@zerodevx/svelte-toast@0"></script>
+ <script>
+ function registerToast() {
83
+ window.toastApp = new window.SvelteToastUMD.SvelteToast({
84
+ target: document.body
85
+ });
86
+ window.toast = window.SvelteToastUMD.toast;
87
+
88
+ // Now you can `toast` anywhere!
89
+ toast.push('Hello world!');
90
+ }
91
+ </script>
92
+ <script async src="https://cdn.jsdelivr.net/npm/@zerodevx/svelte-toast@0" onload="registerToast()"></script>
93
</head>
-<body>
-</html>
94
```
95
96
0 commit comments