值不是由JavaScript函数传递给PHP文件


value is not passed by javascript function to php file

我是JavaScript的新手我自己创建了一个函数,但它不起作用

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

警报和位置正常工作,但第二行: $.post('insert.php', {ns_oi:ns_oi});不工作或可能工作错误!

我创建了这个函数来发送一个值"ns_oi"来插入.php在插入中.php我已经获得了该值并做了一些事情

谁能帮我说出什么问题?

为什么不正确发送它,并正确使用jQuery.post()函数,例如:

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();
    });
}