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'=>'#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()->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.