Created
April 28, 2013 21:28
-
-
Save vjk2005/5478484 to your computer and use it in GitHub Desktop.
g.e-h.org loader
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var s = document.createElement( 'script' ) | |
s.src = 'http://code.jquery.com/jquery-1.8.0.min.js' | |
document.body.appendChild( s ) // load jQuery | |
var current=6, target = 150; | |
function load( url ) { | |
$.get( url, function( data ) { | |
$( '#i4' ).before( $( '#i3', data ).html() ) | |
current++ | |
if( current < target) { | |
setTimeout( function() { load( $('#next', data).attr('href') ) }, 20000 ) | |
} else { | |
console.log('downloaded!') | |
} | |
}) | |
} | |
load( $('#next').attr('href') ) //start |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment