单击按钮后调用另一个页面而不加载页面

I am fetching data from FB and storing in database. After processing completes I want to redirect to test.php wihout page reload. But I dont know how to do it for following complex(for me) code.

I have two function.

function AjaxResponse()
 {
    var mydata;
    CallAfterLogin(mydata, function(send) {
    alert(mydata);
        var myData = 'connect=1'; 
        $.ajax({
        type: "POST",
        url: "process_facebook2.php",
        data: mydata 
        }).done(function(result) {
                        $("#fb-root").html(result);
                     });
               });
  } 

and

function CallAfterLogin(data,callback){
        FB.login(function(response) {  //---
        if (response.status === "connected")
        {
            LodingAnimate(); 
            FB.api('/me?fields=movies,email', function(mydata) {
            console.log(mydata);
              if(mydata.email == null)
              {
                 alert("You must allow us to access your email id!");
                 ResetAnimate();
              }

              else 
        {
            var json = JSON.stringify(mydata.movies.data);
            var a = JSON.parse(json);

            $.post('process_facebook2.php',{'myd':a}, function(data) 
            {
              alert(data);      
            });
        }

Which called by :

<input type="image" src="fb.png" name="getStarted" value="btnBasic1" onclick="AjaxResponse()" height="40" alt="Submit" />

After alert(data) i want it to redirect to some page test.php. How it possible wihout page reload?

You could load the content you want to change via jQuery with .load().

Depending on what test.php contains you could do an AJAX call to load test.php and replace the body of the current page with jQuery.

test.php

$new_body = '<h1>Hi!</h1>';
echo $new_body;

AJAX call

$.ajax({
url:        'test.php'
,async:     true
,cache:     false
,dataType:  'html'
,success:   function(data){
                $('body').html(data);
            }
});