javascript函数没有将值传递给php文件

i'm newbie to javascript and i have create a function by myself but it's not working

function oi_delete(ns_oi){
alert("Are You Sure About DELETE image # " + ns_oi + " ?");
$.post('insert.php', {ns_oi:ns_oi});
location.reload();}

alert and location is working but seconde line: $.post('insert.php', {ns_oi:ns_oi}); is not working or maybe working wrong!

i have create this function to send a value "ns_oi" to insert.php and in insert.php i have get that value and do something

can anyone help me and say what is the problem?

Why don't you send it properly with a jQuery.post() function properly like:

function oi_delete(ns_oi){
    alert("Are You Sure About DELETE image # " + ns_oi + " ?");

    $.post('insert.php', {ns_oi:ns_oi}, function(data) {
        location.reload();
    });

}