如何将jquery var设置为另一个jquery ajax函数回调

Sorry for my terms incase they are incorrect, but I have a php function that I am going to interop with ajax so I can use a php function to get a value for a jquery variable.

So now I am just at the point where I have received the ajax callback and would like to set the jquery variable to the response value I got back. Here is my code as an example:

$(document).ready(function() {


    $('body').videoBG({
        position:"fixed",
        zIndex:0,
        mp4:'', //This is where I want to use the ajax response value 
        opacity:1,
    });

})

       jQuery.ajax({
            type    : "POST",
            url     : "index.php",
            data    : { 
                        request    : "getvideo_Action"
                      },
            success : function(response) {
                                   alert(response);
                //Do my response stuff
                            }
        });  

So basically what I want to do is set the 'Mp4' var(or is it property?) with the value that I get from the response. Can anyone help me out with this? Thanks.

You can put the entire thing inside the success function, like this:

jQuery.ajax({
    type: "POST",
    url: "index.php",
    data: {
        request: "getvideo_Action"
    },
    success: function (response) {
        $('body').videoBG({
            position: "fixed",
            zIndex: 0,
            mp4: response,
            opacity: 1
        });
    }
});