xxxxxxxxxx
<html lang="en">
<head>
<meta charset="utf-8" />
<title>Image Queue</title>
<script src="image-queue.js" type="application/javascript"></script>
</head>
<body>
<script type="application/javascript">
<!--
var queue = ImageQueue();
function getOnloaded(msg)
{
return function(err, img)
{
if(err == undefined)
{
console.log('on loaded', msg, img);
document.body.appendChild(img);
} else {
console.log('error in', msg, err);
}
}
}
queue.add('https://linode.teczno.com/nothing-to-see-here', getOnloaded('Nothing #0'));
queue.add('https://linode.teczno.com/loris.php?delay=1&i=1', getOnloaded('Loris #1'));
queue.add('https://linode.teczno.com/loris.php?delay=2&i=2', getOnloaded('Loris #2'));
queue.add('https://linode.teczno.com/loris.php?delay=3&i=3', getOnloaded('Loris #3'));
queue.add('https://linode.teczno.com/loris.php?delay=1&i=4', getOnloaded('Loris #4'));
queue.add('https://linode.teczno.com/loris.php?delay=2&i=5', getOnloaded('Loris #5'));
queue.add('https://linode.teczno.com/loris.php?delay=3&i=6', getOnloaded('Loris #6'));
queue.process();
queue.cancel('https://linode.teczno.com/loris.php?delay=1&i=4');
queue.cancel('https://linode.teczno.com/loris.php?delay=3&i=6');
setInterval(function() { queue.process() }, 500);
//-->
</script>
</body>
</html>