[eluser]A.M.F[/eluser]
hi all,
i am trying to learn ajax, and i have my simple ajax code:
Code:
function load_list(listURL) {
defaultList = listURL;
display('ajax_wait', 'block'); display('list_rants', 'none');
new Ajax.Updater('list_rants', listURL, {
onComplete:function(request) {
display('ajax_wait', 'none'); display('list_rants', 'block');
}
});
}
function display(element, style) {
eval("document.getElementById('" + element + "').style.display = style;");
}
(it's from the ranting site that someone posted here once)
and this is some of the php:
in the view:
Code:
<?=anchor('#', 'ניסיון', array('id'=>'cat_0', 'onclick'=>"load_list('".site_url_rel('show/test')."'); return false" ))?>
<div id="list_rants"></div>
in the controller:
Code:
function test()
{
header('Content-type: text/html; charset=utf-8');
$this->layout->buildPage('test');
}
i should get the content that inside the test.php file right? but no, i get nothing.
thanks for ur time