Hi All,
In render partial, I am displaying dynamic ajaxLink’s. If i click on ajaxlink it is not working. If I refresh the page then it is working.
I have observed that by default it is loading only one link.
<script type="text/javascript">
/*<![CDATA[*/
jQuery(function($) {
jQuery('body').delegate('#yt0','click',function(){jQuery.ajax({'type':'POST','url':'/exam/index.php?r=exam/next','cache':false,'data':jQuery(this).parents("form").serialize(),'success':function(html){jQuery("#exam-grid").html(html)}});return false;});
});
/*]]>*/
</script>
When i refresh the page it is loading more than one link like
<script type="text/javascript">
/*<![CDATA[*/
jQuery(function($) {
jQuery('body').delegate('#yt0','click',function(){jQuery.ajax({'type':'POST','url':'/exam/index.php?r=exam/next','cache':false,'data':jQuery(this).parents("form").serialize(),'success':function(html){jQuery("#exam-grid").html(html)}});return false;});
jQuery('body').delegate('#yt1','click',function(){jQuery.ajax({'type':'POST','data':{'id':'718'},'url':'/exam/index.php?r=exam/review','cache':false,'success':function(html){jQuery("#exam-grid").html(html)}});return false;});
jQuery('body').delegate('#yt2','click',function(){jQuery.ajax({'type':'POST','data':{'id':'719'},'url':'/exam/index.php?r=exam/review','cache':false,'success':function(html){jQuery("#exam-grid").html(html)}});return false;});
jQuery('body').delegate('#yt3','click',function(){jQuery.ajax({'type':'POST','data':{'id':'722'},'url':'/exam/index.php?r=exam/review','cache':false,'success':function(html){jQuery("#exam-grid").html(html)}});return false;});
jQuery('body').delegate('#yt4','click',function(){jQuery.ajax({'type':'POST','data':{'id':'720'},'url':'/exam/index.php?r=exam/review','cache':false,'success':function(html){jQuery("#exam-grid").html(html)}});return false;});
jQuery('body').delegate('#yt5','click',function(){jQuery.ajax({'type':'POST','data':{'id':'721'},'url':'/exam/index.php?r=exam/review','cache':false,'success':function(html){jQuery("#exam-grid").html(html)}});return false;});
});
/*]]>*/
</script>
How to refresh the page using ajaxlink.
I have tried ‘z controller’ but it is displaying more than one link.
Thanks in advance.
Thanks & Regards,
Gangadhar