par
nico44530 » 23 févr. 2013, 14:21
Voici le code Ajax.
Je ne pense pas avoir 1000 connectés en même temps, c'est un site social sur l'astronomie.
Le script c'est un ajax pour rafraîchir une notification de messagerie (savoir combien de message on reçoit)
[javascript]
function getNotifications() {
$.ajax({
url: "../ajax/notifications.php",
ifModified:true,
statusCode: {
500: function(){
$('#server-500').html('Serveur en surcharge, patientez quelques instants...');
},
},
success: function(content){
$('.messagesValue').html(content);
if(content>0){
$('.messagesValue').css({
'display':'block'
});
}
if(content<1){
$('.messagesValue').css({
'display':'none'
});
}
}
});
setTimeout(getNotifications, 60000);
}
getNotifications();
[/javascript]
Voici le code Ajax.
Je ne pense pas avoir 1000 connectés en même temps, c'est un site social sur l'astronomie.
Le script c'est un ajax pour rafraîchir une notification de messagerie (savoir combien de message on reçoit)
[javascript]
function getNotifications() {
$.ajax({
url: "../ajax/notifications.php",
ifModified:true,
statusCode: {
500: function(){
$('#server-500').html('Serveur en surcharge, patientez quelques instants...');
},
},
success: function(content){
$('.messagesValue').html(content);
if(content>0){
$('.messagesValue').css({
'display':'block'
});
}
if(content<1){
$('.messagesValue').css({
'display':'none'
});
}
}
});
setTimeout(getNotifications, 60000);
}
getNotifications();
[/javascript]