Improve loading of notifications

This commit is contained in:
Karsten Heiken
2011-08-01 15:45:47 +02:00
parent b6a845ee9d
commit dae1b9102f

View File

@@ -1,7 +1,8 @@
function get_notifications() {
$('#notifications').load(SITE_URL + 'ajax/get_notifications',
function() {
$('#notifications').slideDown();
$.get(SITE_URL + 'ajax/get_notifications', function(data) {
if(data.length > 0) {
$('#notifications').append(data).slideDown();
}
});
}
@@ -25,6 +26,6 @@ $(document).ready(function() {
});
$('#notifications').hide();
setInterval(get_notifications(), '5000');
get_notifications();
setInterval('get_notifications()', '5000');
});