Improve loading of notifications
This commit is contained in:
@@ -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');
|
||||||
});
|
});
|
||||||
|
|||||||
Reference in New Issue
Block a user