Java



             

Графические часы - часть 3


var closeImage = ".gif\" HEIGHT=21 WIDTH=16>"

// initialize time-related variables with current date settings

var now = new Date()

var month = now.getMonth()

var date = now.getDate()

var year = now.getYear()

now = null

// convert integer value of month to standard range

month++ // 0 - 11 => 1 - 12

// convert minute and hour values to strings

month += ""

date += ""

year += ""

// assign image tags associated with month to text variable

for (var i = 0; i < month.length; ++i) {

text += openImage + month.charAt(i) + closeImage

}

// assign image tag of period separator to text variable

text += openImage + "p.gif\" HEIGHT=21 WIDTH=9>"

// assign image tags associated with date to text variable

for (var i = 0; i < date.length; ++i) {

text += openImage + date.charAt(i) + closeImage

}

// assign image tag of period separator to text variable

text += openImage + "p.gif\" HEIGHT=21 WIDTH=9>"

// assign image tags associated with year to text variable

for (var i = 0; i < year.length; ++i) {

text += openImage + year.charAt(i) + closeImage

}

// return accumulative HTML string

return text}function getPath(url) {

lastSlash = url.lastIndexOf("/")

return url.substring(0, lastSlash + 1)}

// -->

</SCRIPT>




Содержание  Назад  Вперед