Monday, October 24, 2011

Javascript example 2: Navigator Information

Sometimes you would like to know which browser your users are using.
Here is a script that will display browser name, version, language and other information:
<html>

<body>
    <script>

Javascript example 1: Flushing Text

This is the script for creating flushing text in your webpage:
<script>
    var changeStatus = 0;
    function flushingText()
    {
        if(changeStatus == 0)
        {
            status = "Hello JavaScript...";  //Your text
            changeStatus = 1;
        }
        else
        {
            status = "";
            changeStatus = 0;
        }
        setTimeout("flushingText()",200);  //Timer
    }

</script>

 The whole script will look like this:

 <html>
<head>
<!--
    Flushing text in the statusbar
-->
<script>
    var changeStatus = 0;
    function flushingText()
    {
        if(changeStatus == 0)
        {
            status = "Hello JavaScript...";
            changeStatus = 1;
        }
        else
        {
            status = "";
            changeStatus = 0;
        }
        setTimeout("flushingText()",200);
    }

</script>
</head>

<body onload="flushingText()"><!--Call flushingText method while loading the webpage-->

</body>
</html>


Hello World!

I'm just another developer.I always want to teach people what I learned, so launching tis blog is to achieve this desire.
I will try to post programming examples and resources to learn from.
Hope you enjoy that.