Tuesday, January 17, 2006

How to set Home Page : Java Script

Hyperlink tag
function setHomePage()
{
    this.style.behavior='url(#default#homepage)';
    this.setHomePage('http://gunasekara.coconia.net/');
    return false;"

}

Timed Recursive Function : Java Script

//
// function that executes recursively but it is timed.
//
function animate() {
    k++
    if (k == 5) k = 1
    document.images[k - 1].src = imgArray2[k - 1].src
    if (k > 1)
        document.images[k - 2].src = imgArray1[k - 2].src
    else
        document.images[3].src = imgArray1[3].src
    var timeOutID = setTimeout("animate()", 1000)
} 

Thursday, January 05, 2006

Charactor Validatin : Java Script

//
//A funtion for check a charactor input in a web form
//
function checkIt(evt) {
    evt = (evt) ? evt : window.event
    var charCode = (evt.which) ? evt.which : evt.keyCode
    if ((charCode < 45 || charCode > 57) && charCode != 8 && charCode != 37 && charCode != 39) {
        alert("This field accepts numbers only")
        return false
    }
    return true
}
//
// you can access it from any contorl as follows
//
onKeyPress = 'javascript:return checkIt(event)'

Azure Storage Account Types

Defferent Types of Blobs Block blobs store text and binary data. Block blobs are made up of blocks of data that can be managed individually...