Advertisement
Guest User

example

a guest
Jan 31st, 2015
243
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.35 KB | None | 0 0
  1. function getProgress(){
  2. $.ajax({
  3. url: 'bar.php',
  4. success: function(data) {
  5. var localo = JSON.parse(data);
  6. if(localo.speed_refresh!='done'){
  7. $('#current_bar').html('<pre>'+localo.current_bar+'</pre>');
  8. $('#current_hotel').html(localo.current_hotel);
  9. getProgress();
  10. }
  11. }
  12. });
  13. }
  14.  
  15. function re(vars){
  16. if(!vars){
  17. $("html, body").animate({ scrollTop: 0 }, "slow");
  18. }
  19. $f = vars;
  20. $.ajax({
  21. url: "process.php",
  22. data: $f,
  23. type: "GET",
  24. success: function( json ) {
  25. var local = JSON.parse(json);
  26. $( "#totals_bar" ).html( '<pre>'+local.totals_bar +'</pre>');
  27. $( "#totals_hotel" ).html( local.totals_hotel );//cik kur atrasti
  28. if(local.speed_refresh!='done'){
  29. re(local.stage);
  30. if(!vars){
  31. getProgress();
  32. }
  33. }else{
  34. alert('viss padarīts! \n\n ');
  35. }
  36. },
  37. error: function( xhr, status, errorThrown ) {
  38. alert( "Sorry, there was a problem!" );
  39. console.log( "Error: " + errorThrown );
  40. console.log( "Status: " + status );
  41. console.dir( xhr );
  42. },
  43. complete: function( json ) {
  44.  
  45. }
  46. });
  47.  
  48. }
  49.  
  50.  
  51. <input type="submit" onclick="re('');" name="sakums" value="AIZIET!">
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement