<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="Default.aspx.cs" Inherits="Chapter2._Default" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
    <title>Untitled Page</title>

    <script type="text/javascript" src="ClientLibrary1.js"></script>

    <script type="text/javascript">
//    function proceduralFunction() {
//        // this wskazuje na obiekt okna
//    }
//    proceduralFunction();

//    function clickFunction() {
//        // this wskazuje na przycisk myButton
//    }
//    myButton.onclick = clickFunction;

//    MyObject = function MyObject() {

//        this.method = function() {
//            // this wskazuje na obiekt MyObject
//        }
//    }

//    var my = new MyObject();
//    my.method();
    </script>

</head>
<body>
    <form id="form1" runat="server">
    <div id="abc">
    </div>
    </form>

    <script type="text/javascript">
        var div = document.getElementById("abc");
//        var intervalId = window.setInterval("div.innerHTML += 'witaj!';", 1000);
        var n = {} ;
        n.x = function() { };
        n.make = "abc";
        n.model = "xyz";
        
        for (var name in n)
        {
            div.innerHTML += name;
        }
    </script>

</body>
</html>
