25 Ocak 2012 Çarşamba

Java Script Farklı Mesaj


<script language="Javascript">
<!--
// Her seferinde farklı bir mesaj
// made by: Nicolas - http://www.javascript-page.com
// düzenleyen: Hüsamettin batur http://netinet.cjb.net
var core = 0
var currentdate = 0

function StringArray (n) {
this.length = n;
for (var i =1; i <= n; i++) {
this[i] = ' '

}
}

quote = new StringArray(5)
quote[0] = "Bu 1. mesaj"
quote[1] = "Bu 2. mesaj"
quote[2] = "istikbal göklerdedir"
quote[3] = "Tis time to fear when tyrants seem to kiss"
quote[4] = "The past is pregnant with the present"

author = new StringArray(5)
author[0] = "John Paul Jones"
author[1] = "Thomas Jefferson"
author[2] = "Atatürk"
author[3] = " yazarın adı"
author[4] = "Gottfried Leibniz"

var ran = 60/quote.length

currentdate = new Date()
core = currentdate.getSeconds()
adcore = Math.floor(core/ran)
core = adcore

var thequote = quote[core]
var theauthor = author[core]
var thebreak = ' - '
var theq = '"'
var theend = '.'

document.write(theq + thequote + theq + thebreak + theauthor + theend)

//-->
</script>

Açıklama :
Yukarıdaki kodları sayfanızda <body>..</body> takıları arasındaistediğiniz yere koyabilirsiniz.
  
   İ.E. ve Netscape'de çalışır.

Hiç yorum yok:

Yorum Gönder