Transfer with ajax request to another page

Hi i want on click on google maps marker on my view: google.php to transfer me to another view profile.php, and also to get information from marker and to transfer to that page. I make this in js file:

(function (marker, data) {

                    google.maps.event.addListener(marker, "click", function (e) {

// window.location = marker.url + "?lat=" + marker.position.k + "&lon=" + marker.position.B + "&title=" + encodeURIComponent(marker.title);

                        console.log(title);


                        profile1();


                    });


                })(marker, data);

function profile1() {

var title = "DDD";

$.ajax({


    type: "POST",


    dataType: "json",


    url: "profile/",


    data: {title:  title},


    success: function (data) {

// console.log(data.coordinates);

// $("#t-name").html(title);

        alert(data);


    }


});


console.log('d');

}

and on my controller is this function:

public function actionProfile() {

    if (Yii::$app->request->isAjax) {


        Yii::$app->response->format = Response::FORMAT_JSON;


        $temp = Yii::$app->request->post('title');


        print_r($temp);


        $response['title'] = $temp;


    }


    return $this->render('profile');


}

But i m still on google.php view , i want to transfer on profile.php

Thanks in advance.

Your ajax success handler doesn’t do anything except alert(). If you want the browser to load a different page then I think the normal way is to write to window.location.