Advertisement
hombretao

configUpdate()

Jul 23rd, 2014
250
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. function configUpdate() {
  2.     var config = getConfig();
  3.     config.success(function (data) {
  4.         var result = (data === '1') ? true : false;
  5.         if(result) {
  6.             iniciar();
  7.         }
  8.         setTimeout(configUpdate, 500);
  9.     });
  10. }
  11.  
  12. function iniciar() {
  13.     return $.ajax({
  14.         url: "/getVideo.php",
  15.         cache: false,
  16.         success: function(html) {
  17.             $('#video').html(html);
  18.             $('#video').css('display', 'inherit');
  19.             setTimeout(function() {
  20.                 $('#video').css('display', 'none');
  21.                 setTimeout(switchOff,1000);
  22.             }, 3000);
  23.         }
  24.     });
  25. }
  26.  
  27. function switchOff() {
  28.     $.ajax({
  29.         url: "/switchOff.php",
  30.         cache: false
  31.     });
  32. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement