Dynamic site content using AJAX

Hi all, from some time I’ve got really irritating problem.

In a nutshell: I want to fallowing PHP code:


echo 'first';

sleep(1);

echo 'second';

sleep(1);

echo 'third';

appear line by line on the website. Actually I’ve found the solution using jQuery AJAX Http Stream (here’s example code: plugins.jquery.com/project/ajax-http-stream), but I’m struggling to implement it on Yii framework. I know there’s ajaxSubmitButton method in CHtml, but I read documentation, every code I found and still I can’t make it work, so currently I tried simple solution:


<button onclick="execute('/ESWebPanel/panel/test');">Click</button>

and


function execute(path)

{

    $.post(path, 

    function(data, status) /* On Request Complete */

    {

        alert(html(data));

    },

    function(packet, status, fulldata, xhr) /* If the third argument is a function it is used as the OnDataRecieved callback */

    {

        alert(html(data));

    });

}



and path looks valid but nothing happens (JavaScript is executed but not php). I’ve got action test in this file and I’ve tried also load any php (I’m giving relative path, example: /ESWebPanel/php_file/file_to_load.php) file but still nothing…

I appreciate any help…