Hi I was wondering if anyone knows of a jquery plugin to create a behavior similar to the notification header that appears on Stack Overflow. I understand how to hide and show elements, I dont know how to make its toggle status be persistent throughout the site. I guess basically what I am asking is how to add cookies in the script so the notification does not continue to show if someone closes it and then goes to another page.
+1
A:
I'm not much of a web UI guy, but I'd make the "close" button on the notification make an AJAX request back to the server to tell it that the notification has been cleared. (Whether or not you use the result of that request to do anything is up to you - I can't imagine there's much you'd want to do, beyond perhaps refreshing the list of notifications in case a new one came up in the meantime.)
Basically keep a list of "current notifications" to show the user, and remove them as the user clears them from the UI.
Jon Skeet
2009-05-01 06:50:07
+2
A:
You can also use the jQuery Cookie plugin to read and write the value of whether a notification message was shown or not.
ichiban
2009-05-01 07:04:43