You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I appear to be encountering an error when trying to pop a notification on document load. When run in the CodePen it seems to run fine but on my hosting it encounters an error. I'll post links to both so you can see.
Is running before Snarl can initialise itself. The reason this usually isn't an issue is because a notification tends to only be created on a button click event, rather than on the same $(document).ready event that you're also listening on.
As a temporary workaround if you need Snarl to launch immediately on the $(document).ready event: wrapping the Snarl.addNotification function in a setTimeout(..., 10) will allow the Snarl initialiser function to be injected into the browser's event queue ahead of the addNotification function 99.9% of the time.
On the other hand, if you're planning to only use Snarl in events which occur after the $(document).ready you should be fine 👍
Thank you so much! I figured the ready function would give it enough time but I guess I was wrong. I updated the code to include a timeout and it worked! Thanks!
I appear to be encountering an error when trying to pop a notification on document load. When run in the CodePen it seems to run fine but on my hosting it encounters an error. I'll post links to both so you can see.
CodePen
Hosting
The text was updated successfully, but these errors were encountered: