Skip to content

Instantly share code, notes, and snippets.

@superbrothers
Created July 3, 2011 13:13
Show Gist options
  • Save superbrothers/1062218 to your computer and use it in GitHub Desktop.
Save superbrothers/1062218 to your computer and use it in GitHub Desktop.
<?php
function timestamp() {
echo time();
}
?>
<!DOCTYPE html>
<html>
<head>
</head>
<body>
<input type="button" id="button" value="LOAD">
<ul>
<li><img data-src="http://tiqav.com/2LC.th.jpg?<?php timestamp(); ?>"></li>
<li><img data-src="http://tiqav.com/Fy.th.jpg?<?php timestamp(); ?>"></li>
<li><img data-src="http://tiqav.com/1Ci.th.jpg?<?php timestamp(); ?>"></li>
<li><img data-src="http://tiqav.com/j5.th.jpg?<?php timestamp(); ?>"></li>
</ul>
<script>
<!--
document.getElementById('button').addEventListener('click', function () {
loadImage(document.getElementsByTagName('img'));
this.removeEventListener('click', arguments.callee, false);
}, false);
function loadImage(nodeList) {
[].forEach.call(nodeList, function (img) {
var src = img.getAttribute('data-src');
if (src !== undefined) {
img.setAttribute('src', src);
}
});
}
-->
</script>
</body>
</html>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment