Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    text
    copied!<p>EDIT: So my initial answer was just bad, I'm getting rid of it. Forget it ever happened. The concept was decent but I forgot about cross-domain policy, so I combined a few other methods to make this work. This won't require you to write your own back-end code, but I recommend you replace the YUI with your own code that does something similar. Tested with jsfiddle. </p> <p>The underlying thing here is you need to make sure that you can just get this working via making sure the server responds as you'd expect. So I'm using your gravatar and mine as tests, and the YUI framework to perform the actual request (via a json request in jquery).</p> <pre><code>var images = ["https://en.gravatar.com/userimage/3532627/52159e585800d69265e0a1819c4dde54.jpg?size=80","http://www.gravatar.com/avatar/e08d91a83ce8dd7b88aaaae4aec58074?s=128&amp;d=identicon&amp;r=PG"], imagelen = images.length, newimages = []; while(imagelen--) { var url = images[imagelen]; $.getJSON("http://query.yahooapis.com/v1/public/yql?"+ "q=select%20*%20from%20html%20where%20url%3D%22"+ encodeURIComponent(url)+ "%22&amp;format=xml'&amp;callback=?", function(data){ console.log(data); if(data.results[0]){ // sweet newimages.push(images[imagelen]); images.splice(imagelen,1); if (images.length === 0) { // last one, fire callback doFancyBoxStuff(); } } else { // d'oh! images.splice(imagelen,1); if (images.length === 0) { // last one, fire callback doFancyBoxStuff(); } } } ); } function doFancyBoxStuff() { console.warn("fired callback"); } </code></pre>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload