Another way to load images using JavaScript
When you write code in JavaScriputer system.
Below is the another way to load images from JavaScript code.
<img src="data:image/png;base64,R0lGODlhAQABAAD/ACwAAAAAAQABAAACADs=" data-src="http://www.mysite.com/media/t1.png">
function initS() {
var myimg = document.getElementsByTagName('img');
for (var i=0; i<myimg.length; i++) {
if(myimg[i].getAttribute('data-src')) {
myimg[i].setAttribute('src',myimg[i].getAttribute('data-src'));
}
}
}
setTimeout("initS();", 20000);
</script>
connect On of OFF.
Below is the another way to load images from JavaScript code.
<img src="data:image/png;base64,R0lGODlhAQABAAD/ACwAAAAAAQABAAACADs=" data-src="http://www.mysite.com/media/t1.png">
function initS() {
var myimg = document.getElementsByTagName('img');
for (var i=0; i<myimg.length; i++) {
if(myimg[i].getAttribute('data-src')) {
myimg[i].setAttribute('src',myimg[i].getAttribute('data-src'));
}
}
}
setTimeout("initS();", 20000);
</script>
connect On of OFF.
0 comments:
Post a Comment