I hace code for today's date in image url and link url, this:
In HEAD:
<script>
Date.prototype.toMyString = function () {
//If month/day is single digit value add perfix as 0
function AddZero(obj) {
obj = obj + '';
if (obj.length == 1)
obj = "0" + obj
return obj;
}
var output = "";
output += this.getFullYear();
output += AddZero(this.getMonth()+1);
output += AddZero(this.getDate());
return output;
}
var d = new Date();
var link = document.getElementById("image");
link.setAttribute("src","http://cache3-img1.pressdisplay.com/pressdisplay/docserver/getimage.aspx?file=6107"+d.toMyString()+"00000000001001&page=1&scale=67");
var link = document.getElementById("link");
link.setAttribute("href","http://www.pressdisplay.com/pressdisplay/pageview.aspx?issue=6107"+d.toMyString()+"00000000001001");
</script>
In BODY:
<center>
<img id="image" width="300">
<br/>
<a id="link" href="#">Read Today Epaper
<script type='text/javascript'>
<!--
var months = ['Januari', 'Februari', 'Maret', 'April', 'Mei', 'Juni', 'Juli', 'Agustus', 'September', 'Oktober', 'November', 'Desember'];
var myDays = ['Minggu', 'Senin', 'Selasa', 'Rabu', 'Kamis', 'Jum'at', 'Sabtu'];
var date = new Date();
var day = date.getDate();
var month = date.getMonth();
var thisDay = date.getDay(),
thisDay = myDays[thisDay];
var yy = date.getYear();
var year = (yy < 1000) ? yy + 1900 : yy;
document.write(thisDay + ', ' + day + ' ' + months[month] + ' ' + year);
//-->
</script></a>
</center>
DEMO:
http://www.epaper.pustakakoran.com/thejakartapost/
How to change that's code to yesterday's date in image url and link url? Thank for all.