Advertisement
Guest User

Untitled

a guest
Dec 10th, 2016
64
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.78 KB | None | 0 0
  1. getTable = function (url) {
  2. $.ajax({
  3. url: '/get_items_list',
  4. async: false,
  5. dataType: 'json',
  6. error: function () {},
  7. success: function (data) {
  8. $('table.table > tbody').empty();
  9. $.each(data, function (key, value) {
  10. $('table.table > tbody').append('<tr><td>' + value.name + '</td><td class="text-right ' + (value.belong_status ? 'success' : 'fail') + '">Ячейка ' + value.cell_num + '</td></tr>');
  11. });
  12. },
  13. complete: function () {
  14. $.each(data, function (key, value) {
  15. if ( value.session_status == False ) {
  16. redirect_to("/index");
  17. }
  18. }
  19. clearTimeout( execu_timer );
  20. execu_timer = setTimeout( function () {
  21. getTable(url);
  22. }, 1000 );
  23. }
  24. });
  25. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement