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,8 +1,9 @@
function get_notifications() { function get_notifications() {
$('#notifications').load(SITE_URL + 'ajax/get_notifications', $.get(SITE_URL + 'ajax/get_notifications', function(data) {
function() { if(data.length > 0) {
$('#notifications').slideDown(); $('#notifications').append(data).slideDown();
}); }
});
} }
$(document).ready(function() { $(document).ready(function() {
@@ -24,7 +25,7 @@ $(document).ready(function() {
return false; return false;
}); });
$('#notifications').hide(); $('#notifications').hide();
get_notifications();
setInterval(get_notifications(), '5000'); setInterval('get_notifications()', '5000');
}); });