Can I get Ajax html response and pop a part of the result into a javascript variable?

Can I get Ajax html response and pop a part of the result into a javascript variable?

I want to populate Ajax response and set a part of it into a new variable.

   

$ . ajax ({

    type : "POST" ,

    url : " ajax.php" ,

    data : "id=" + id ,

    success : function ( data ){

        $ ( "#response" ). html ( data );

        var new_var = $new_result;

    }

});




========== [[ ajax.php]]

       $new_result = 'hahahha';

       echo $all_names;

       echo $all_address;