Hello everyone,
I am new to prototype, and I am trying to implement a simple ajax
request
I wrote the index.html file, and the clock.html file

index.html

<!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"; xml:lang="en" lang="en">
<head>
<meta http-equiv="content-type" content="text/html; charset=utf-8" />
<title> Test Page </title>
<script type="text/javascript" src="../prototype.js"></script>
<script>
        function getClock() {
                var url = 'data/clock.html';
                var myAjax = new Ajax.PeriodicalUpdater(
                        'clockArea',
                        url,
                        {
                                method: 'get',
                                frequency: 2,
                                onFailure: function(resp) {alert("Failure : "+
resp.statusTest,"test");},
                                onException : function(resp, 
exception){alert("exception "+
exception,"test");}
                        });
                }
</script>
</head>
<body>
        <input type="button" value="Test" onclick="getClock();"/><br/> <br/>
<br/>
        <p><div id="clockArea"></div></p>
</body>
</html>

and the clock.html


<html>
<head>
<script type="text/javascript">
function display()
{
        var myscriptTime  = new Date();
        document.write(myscriptTime)

}
</script>
</head>
<body onload=display()>

</body>
</html>



clock.html displays the date correctly, but when I click the btn in
the first file the time is not displayed
and there is no errors. "onSuccess it alerts a msg"



any body can help me please.
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"Prototype & script.aculo.us" group.
To post to this group, send email to prototype-scriptaculous@googlegroups.com
To unsubscribe from this group, send email to 
prototype-scriptaculous+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/prototype-scriptaculous?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to