Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- Error : 429 (Too Many Requests)
- setInterval(function(){
- refresh()
- }, 5000);
- function refresh(){
- $.ajax({
- type: 'GET',
- url: 'api/notify',
- success: function(res){
- if(data != res.length){
- // console.log('actualizar!')
- data = res.length
- var obj = JSON.parse(JSON.stringify(res))
- $.each( obj, function( key, value ) {
- var num = key + 1
- mensaje += "Mensaje "+ num +": "+ value.mensaje
- });
- $('.messages').text(mensaje)
- }else{
- // console.log('no actualizar!')
- }
- }
- });
- }
Add Comment
Please, Sign In to add comment