Quantcast
Channel: Yii Framework Forum
Viewing all articles
Browse latest Browse all 18717

Ajax Response Dosen't Work In Module

$
0
0
Hi everyone.

I have a module and i wrote a simple ajax call on click event, i would like to get some dat from controller with this call.

I have no errors but in ajax success function i can't get the message from controller's function


module/controller/BackEndAjaxController.php
        
        public function actionGetSpecificUserData()
        {
            if( !empty( $_POST["id"] ) )
            {
                print $_POST["id"]; exit;
                //echo $_POST["id"]; exit 
            }
            
        }



javascript

 $(".details").click(function(){
            
            var id = $(this).attr("id");
            
            $.ajax({
                type: "POST",
                url: baseUrl+"ControlPanel/BackEndAjax/getSpecificUserData",
                data: ({"userid" : id}),
                dataType : 'text'

              }).done(function( msg ) {
                    alert( "Data Saved: " + msg );//here only alert "Data Saved" without msg
                  });
        })


i am sorry for my English

Viewing all articles
Browse latest Browse all 18717

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>