Tarikh dan ucapan untuk blog
Jika korang nak letak ucapan yang berbeza untuk hari yang berbeza dekat blog korang,ikut langkah yang simple ni.
Demo
Perhatikan ucapan aluan ni pada blog demo,ia akan berbeza pada hari yang berbeza
Langkah-langkah:
1.Pergi ke dashboard--->Design--->Page Element
2.Add a gadget-->Pilih HML/Javascript
3.Pastekan kod ni
<script type='text/javascript'>
//<![CDATA[
var mydate=new Date()
var year=mydate.getYear()
if (year < 1000)
year+=1900
var day=mydate.getDay()
var month=mydate.getMonth()
var daym=mydate.getDate()
if (daym<10)
daym="0"+daym
var dayarray=new Array("Hari ni Ahad,jom jenjalan","Hari ni Isnin,apa khabar","Selasa,dah makan?","Hari ni Rabu,jangan lupa follow","Hari ni Khamis,hah buat apa tu?","Hari ni Jumaat tau!","Hari Sabtu,cuti cuti Malaysia")
var montharray=new Array("January","February","March","April","May","June","July","August","September","October","November","December")
document.write("<p>"+dayarray[day]+", "+montharray[month]+" "+daym+", "+year+"</p>")
//]]>
</script>
//<![CDATA[
var mydate=new Date()
var year=mydate.getYear()
if (year < 1000)
year+=1900
var day=mydate.getDay()
var month=mydate.getMonth()
var daym=mydate.getDate()
if (daym<10)
daym="0"+daym
var dayarray=new Array("Hari ni Ahad,jom jenjalan","Hari ni Isnin,apa khabar","Selasa,dah makan?","Hari ni Rabu,jangan lupa follow","Hari ni Khamis,hah buat apa tu?","Hari ni Jumaat tau!","Hari Sabtu,cuti cuti Malaysia")
var montharray=new Array("January","February","March","April","May","June","July","August","September","October","November","December")
document.write("<p>"+dayarray[day]+", "+montharray[month]+" "+daym+", "+year+"</p>")
//]]>
</script>
Nota:
Ubah ayat yang berwarna tersebut dengan ucapan yang diingini.
8 ulasan
menarik..nak try nanti..terima kasih..
Reply@Nazz@Purple Sesama =)
Replynice info!
Reply@niesz Thanks =)
Replykalau nk wat cm status fb tu ada x?
Replyyeke? camne nk wat tu? hehe.. kuno nyer fiq =P
Reply@fiq Klik link ni :)
ReplyBadge Maker
@fiq Pilih profile badge,lepas dah edit klik kat +blogger
ReplyHarap membantu =)
Nota: Hanya ahli blog ini sahaja yang boleh mencatat ulasan.