Please send questions to st10@humboldt.edu .
<html>

<!-- 
     js_onload_cookie2.html

     by: Sharon Tuttle
     last modified: 09-19-06
-->

<head> 
    <title> js_onload_cookie2.html </title>

</head>

<body>
    <h3> js_onload_cookie2.html </h3>

    <h4> (by Sharon Tuttle, last modified 09-19-06) </h4>

    <hr>

    <script type="text/javascript">
        <!--

        // get array of cookie name-value pairs

        cookieArray = document.cookie.split(";")

        // see if there is a name cookie amongst those cookies

        var userName = ""
        for (var i=0; i < cookieArray.length; i++)
        {
            // separate name and value in current cookie name-value pair

            nameVal = cookieArray[i].split("=")

            // when split on =, there is an EXTRA BLANK in front
            //    all but the first name-value pair
            //    Strip off this blank

            if (nameVal[0].charAt(0) == " ")
            {
                nameVal[0] = nameVal[0].substr(1)
            }

            if (nameVal[0] == "name")
            {
                userName = nameVal[1]
            }
        }

        if ((userName != "") && (userName != null))
        {
            document.write("<h1> HOWDY, " + 
                           userName, "! </h1>")
        }

        //-->
    </script>
    <noscript>
        <h1> Your browser does not support JavaScript; this page will not work
             </h1>
    </noscript>

    <ul>
    <li> <a href="js_onload_cookie3.html"> js_onload_cookie3.html </a>
    </ul>

</body>

</html>