Skip to content

Instantly share code, notes, and snippets.

@sTiLL-iLL
Last active August 29, 2015 14:03
Show Gist options
  • Save sTiLL-iLL/2c1c9e7d2b9f4347b8bc to your computer and use it in GitHub Desktop.
Save sTiLL-iLL/2c1c9e7d2b9f4347b8bc to your computer and use it in GitHub Desktop.
// caching script fetcher //
var futrs = {};
var ajaxFetch = function( url, cBak ) {
if ( !futrs[ url ] ) {
futrs[ url ] = $.Deferred(function( defer ) {
$.getScript( url )
.then( defer.resolve, defer.reject );
}).promise();
}
return futrs[ url ].done( cBak );
};
-----------------------------------------------------------------------
// << use it! >>
ajaxFetch('//totalPorn247.com/freeVideos/Tits+Ass?=199BOOBzInVIEW.js', cBak);
function cBak(resp) {
if(resp.length > 0) {
var dd = document.querySelector('#resultDiv');
dd.innerHTML = renderDirtyWords(a, z, 125);
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment