Hi folks. So far I have managed to  get dataloading into a div froma
php script. This script just passes the time on the server in a div to
the javascript below. I am trying to get the last loaded data to call
Effect.Highlight but it seems to highlight the 2nd last data instead.
Can anyone see what's going wrong here? I've tried everywhere to solve
this.
Check the code in action here http://gramac4.freeserverhost.com/test.php.

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
       "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.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" />
                <link href="includes/initial.css" rel="stylesheet" 
type="text/css" /
>
                <link href="includes/style.css" rel="stylesheet" 
type="text/css" />
                <style type="text/css">
                        .testtime {
                                border:1px solid #000;
                                padding: 5px;
                                margin-bottom: 2px;
                        }
                </style>
                <script src="includes/prototype.js" 
type="text/javascript"></script>
                <script src="includes/scriptaculous.js" 
type="text/javascript"></
script>
                <script type="text/javascript">
                        var ajaxPopulater = function (id,url){
                                url  = url + '?StopCache=' + new Date;
                                new Ajax.PeriodicalUpdater(id, url,
                                {
                                        method: 'post',
                                        frequency: 1,
                                        asynchronous: true,
                                        insertion: Insertion.Top,
                                        onSuccess: highlight,
                                        decay: 1
                                });
                        }
                        var highlight = function(originalRequest){
                                new Effect.Highlight('test');
                        }
                </script>

                <title></title>

        </head>

        <body onload="javascript:ajaxPopulater('latest','/ajax.php')">

                <div id="latest"></div>

        </body>
</html>

ajax.php
<?php
        $time = time();
        echo '<div class="testtime" id="test">' . $time . '</div>' . "\n";
?>

Thanks in advance!


--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "Ruby 
on Rails: Spinoffs" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/rubyonrails-spinoffs?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to