enrichissement/public/scripts/enrichissement.js

32 lines
763 B
JavaScript
Raw Normal View History

2012-01-13 16:15:53 +00:00
$(document).ready(function(){
2012-01-19 15:25:47 +00:00
$("a.setprofil").click(function(e){
e.preventDefault();
var profil = $(this).parent('td').find('select[name=profil] option:selected').val();
$.post($(this).attr('href'), {idprofil: profil}, function(data){
if (data!='Erreur'){
window.location.href = '/';
}
});
});
$(document).focusin(function(){
timer = setInterval(updateInfo, 30000);
});
$(document).focusout(function(){
clearInterval(timer);
});
timer = setInterval(updateInfo, 30000);
});
var timer;
function updateInfo()
{
$('tr.encours').each(function(){
var objet = $(this);
var id = $(this).attr('id');
$.getJSON('/index/getinfo', {id: id}, function(data){
2012-01-30 15:11:33 +00:00
if (data!=''){ objet.find('td.ligne').text(data.nbLigneT); }
});
});
}