Skip to content

Instantly share code, notes, and snippets.

@ZeroDragon
Created November 9, 2014 04:16
Show Gist options
  • Save ZeroDragon/abd153fd251e32a64e55 to your computer and use it in GitHub Desktop.
Save ZeroDragon/abd153fd251e32a64e55 to your computer and use it in GitHub Desktop.
batch download images
func = function(){
var jq = document.createElement('script');
jq.src = "//ajax.googleapis.com/ajax/libs/jquery/1/jquery.min.js";
document.getElementsByTagName('head')[0].appendChild(jq);
timer = setTimeout(function(){
jQuery.noConflict();
jQuery('img').each(function(k,v){
src = jQuery('img').eq(k).attr('src');
jQuery('#deleteME').remove();
anchor = jQuery('<a/>',{
'href' : src,
'download' : src,
'id':'deleteME'
});
jQuery('body').append(anchor);
anchor[0].click();
});
},1000); //le damos tiempo para que cargue el jquery
};
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment