Ajax not working

Ajax not working

Hello All,

I am trying to use ajax to post variable to a different php page. But for some reason it is not working.
I used the following code

$.ajax({
        url
: "phppage.php",
        type
: "post",
        data
: {"variable":"value"},
       
});
In the php page I am accessing it using:
$variable = $_POST['variable'];
when I echo the variable, nothing is outputting.
I am not able to figure out where is the error. This is the first time I am using ajax.
Please help me.

Thanks