JSON-тест


* Файл test.php

<html>
    <head>
        <script src="jquery.min.js"></script>
    </head>
    <body>
        <?php echo date("Y-m-d H:i:s"); ?>
        <hr/>
        <div id="board">
            board
        </div>
        <hr/>
        <input id="mybut1" type="button" value="AJAX">
        <input id="mybut2" type="button" value="JSON">
        
        <script type="text/javascript">
            $(document).ready(function(){
                alert("Ready to start!");
                $("#mybut1").click(function(){
                    $("#board").load('ajax.php');
                    console.log('obj.test');
                });
                
                $("#mybut2").click(function(){
                    $.getJSON('json.php', {a:"test1"}, function(json) {
                        alert(json.date);
                    });
                });
            });
        </script>
        
    </body>
</html>