Sunday, March 12, 2017

yii2 Ajax Request Post


Html::a($service->name_en,'#', [
                         'title' => 'Ajax Title',
                         'onclick'=>"
                         $.ajax({
                        type     :'POST',
                        cache    : false,
                        data: {id: $service->id},
                        url  : '".Url::to(['site/cattt'])."',
                        success  : function(response) {
                                $('#showw').html(response);
                        },
                        error: function(){
                          console.log('failure');
                        }
                        });return false;",
                       ])

No comments:

Post a Comment