SHARE
TWEET

Untitled

a guest Apr 18th, 2019 87 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1.  
  2.  
  3.  
  4. function load_next_40(){
  5.  
  6.     current_id = parseInt($('#table_last_id').text());
  7.     $('#table_first_id').text(current_id);
  8.  
  9.     for(var i = 0; i<40; i++){
  10.         $("#mytabellabella > tbody > tr").eq(i).html("<div id='row_"+(current_id+i)+"' style='display: none;''>"+i+"</div>");
  11.         $.get('https://www.pokemonbattlearena.net/members/pokemon.php?ID='+(current_id+i), {}, function(data){
  12.         try{
  13.         var el = $( '<div></div>' );
  14.         el.html(data);
  15.         var tabella = ($('table', el))[0].innerHTML;
  16.         var riga_info = $ ( '<div></div>');
  17.         riga_info.html(tabella);
  18.         var pokemn = $('td b',$('tr', riga_info)[0])[0].innerHTML;
  19.         var special = $('td', $('tr', riga_info)[1])[1].innerHTML;
  20.         var user = $('td', $('tr', riga_info)[4])[1].innerHTML;
  21.         var id = $('td', $('tr', riga_info)[7])[1].innerHTML;
  22.         var row_index = parseInt($('#row_'+id.substr(6)).text());
  23.         if( special == '&nbsp;Void' || special == '&nbsp;Albino' || special == '&nbsp;Golden' ) {
  24.             pokemn = '<h4><b>'+pokemn+'</b></h4>';
  25.             special = '<h4><b>'+special+'</b></h4>';
  26.             var link_search_user = 'https://www.pokemonbattlearena.net/members/search.php?U='+user.substr(6);
  27.  
  28.             user = '<h4><a href=\''+link_search_user+'\' target=\'_blank\' >'+user+'</a></h4>';
  29.            
  30.             var link_id = 'https://www.pokemonbattlearena.net/members/pokemon.php?ID='+id.substr(6);
  31.  
  32.             id = '<h4><a href=\''+link_id+'\'  target=\"_blank\" >'+id+'</a></h4>';
  33.         }
  34.         $('#mytabellabella > tbody > tr').eq(row_index).html('<td>'+pokemn+'</td><td>'+special+'</td><td>'+user+'</td><td>'+id+'</td>');
  35.         //$('.table.table-striped').append('<tr><td>'+pokemn+'</td><td>'+special+'</td><td>'+user+'</td><td>'+id+'</td></tr>');
  36.         var current_last_id = parseInt($('#table_last_id').text());
  37.         $('#table_last_id').text(current_last_id+1);
  38.         }catch(error){
  39.         }
  40.         });
  41.         }
  42. }
  43.  
  44. function load_prev_40(){
  45.     current_id = parseInt($('#table_first_id').text());
  46.     $('#table_last_id').text(current_id);
  47.  
  48.     for(var i = 0; i<40; i++){
  49.         $("#mytabellabella > tbody > tr").eq(i).html("<div id='row_"+(current_id-i)+"' style='display: none;''>"+i+"</div>");
  50.  
  51.         $.get('https://www.pokemonbattlearena.net/members/pokemon.php?ID='+(current_id-i), {}, function(data){
  52.         try{
  53.         var el = $( '<div></div>' );
  54.         el.html(data);
  55.         var tabella = ($('table', el))[0].innerHTML;
  56.         var riga_info = $ ( '<div></div>');
  57.         riga_info.html(tabella);
  58.         var pokemn = $('td b',$('tr', riga_info)[0])[0].innerHTML;
  59.         var special = $('td', $('tr', riga_info)[1])[1].innerHTML;
  60.         var user = $('td', $('tr', riga_info)[4])[1].innerHTML;
  61.         var id = $('td', $('tr', riga_info)[7])[1].innerHTML;
  62.         var row_index = parseInt($('#row_'+id.substr(6)).text());
  63.  
  64.         if( special == '&nbsp;Void' || special == '&nbsp;Albino' || special == '&nbsp;Golden' ) {
  65.             pokemn = '<h4><b>'+pokemn+'</b></h4>';
  66.             special = '<h4><b>'+special+'</b></h4>';
  67.             var link_search_user = 'https://www.pokemonbattlearena.net/members/search.php?U='+user.substr(6);
  68.  
  69.             user = '<h4><a href=\''+link_search_user+'\' target=\'_blank\' >'+user+'</a></h4>';
  70.            
  71.             var link_id = 'https://www.pokemonbattlearena.net/members/pokemon.php?ID='+id.substr(6);
  72.  
  73.             id = '<h4><a href=\''+link_id+'\'  target=\"_blank\" >'+id+'</a></h4>';
  74.         }
  75.         $('#mytabellabella > tbody > tr').eq(row_index).html('<td>'+pokemn+'</td><td>'+special+'</td><td>'+user+'</td><td>'+id+'</td>');
  76.  
  77.         //$('.table.table-striped').append('<tr><td>'+pokemn+'</td><td>'+special+'</td><td>'+user+'</td><td>'+id+'</td></tr>');
  78.         var current_last_id = parseInt($('#table_first_id').text());
  79.         $('#table_first_id').text(current_last_id-1);
  80.         }catch(error){
  81.         }
  82.         });
  83.         }
  84. }
  85.  
  86. // 30105254 actual id
  87. var current_id = 30216502;
  88. // 26356119  
  89.  
  90. // --- before 26346428  golden gible bidoff 28771316  30133625 30124075 30148354 tailow 30226418
  91. $("center").empty();
  92. $('.heading').remove();
  93. $(".progress").remove();
  94. $('.alert.alert-info').remove();
  95. $('.container')[1].remove();
  96.  
  97. $("center").append("First ID: <div id='table_first_id'></div>");
  98. $("center").append("Last ID: <div id='table_last_id'></div>");
  99. $("center").append(" <button onclick='load_prev_40()'>Load previous  40</button>");
  100. $("center").append(" <button onclick='load_next_40()'>Load next 40</button>");
  101.  
  102. $('#table_first_id').text(current_id);
  103. $('#table_last_id').text(current_id);
  104. $('.table.table-striped').empty();
  105.  
  106. for( var i=0; i<40; i++){
  107.     $('.table.table-striped').append('<tr><td>ciao'+i+'</td><td>ciao</td><td>ciao</td><td>ciao</td></tr>');
  108. }
  109. $('.table.table-striped').attr('id','mytabellabella');
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top