ajaxlink issues

Hi,

I am a beginner in Yii.I am facing some issues with ajaxlink.

I have a ajaxlink created but the href of that link is always set to # and nothing seems to happen when i click that link.

The code for my view is

<div class="content">

<?php

echo CHtml::ajaxLink(

"list",

CController::createUrl(‘ajax’),

array(

'update'=&gt;'#req_res'

),

array("style"=>"color:#333;")

);

?>

<div id="req_res">…</div>

</div>

and my action looks like

public function actionajax() {

echo date('H:i:s');





Yii::app()-&gt;end();

}

The jquery code that is generated is

<script type="text/javascript">

/<![CDATA[/

jQuery(function($) {

jQuery(‘body’).undelegate(’#yt0’,‘click’).delegate(’#yt0’,‘click’,function(){jQuery.ajax({‘url’:’/oveigo/ajax/ajax’,‘cache’:false,‘success’:function(html){jQuery("#req_res").html(html)}});return false;});

});

/]]>/

</script>

Please let me now what i am doing wrong.Any help is greatly appreciated.

Is /oveigo/ajax/ajax the correct path?

Matt

here is the breakdown for the url

/oveigo/ajax[controllername]/ajax[action]

Yes: correct the url of CController::createUrl();

CController::createUrl(‘ajax’); is correct?

I’d tryed your code and is correct except this stuff.