Advertisement
Guest User

Untitled

a guest
Aug 13th, 2016
193
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.66 KB | None | 0 0
  1. var jq = document.createElement('script');
  2. jq.src = "https://ajax.googleapis.com/ajax/libs/jquery/2.1.4/jquery.min.js";
  3. document.getElementsByTagName('head')[0].appendChild(jq);
  4. setTimeout(function(){
  5. var increment = parseInt(localStorage.getItem('increment'));
  6. if(increment){
  7. loop(increment);
  8. }
  9. else {
  10. loop(0);
  11. }
  12. }, 4000);
  13. function loop(i){
  14. setTimeout(function(){
  15. console.log(i);
  16. var downloads = $('#table_holder a');
  17. var button = downloads[i];
  18. console.log(button);
  19. if(button){
  20. var href = $(button).attr('href');
  21. i++;
  22. localStorage.setItem('increment', i);
  23. window.location.href = href;
  24. loop(i);
  25. }
  26. }, 2000);
  27. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement