Javascript 与location.reload一起使用时,可拖放/可拖放不更新数据库(true)

Javascript 与location.reload一起使用时,可拖放/可拖放不更新数据库(true),javascript,jquery,drag-and-drop,Javascript,Jquery,Drag And Drop,我正在创建一个更新数据库的装瓶日历。但我在可拖动和可拖放功能方面遇到了一些问题。我希望在我将装瓶从一个日期拖到另一个日期后重新加载屏幕,但无论何时我放入location。重新加载(true)如果我获取location,这将停止已删除的函数的工作。重新加载(true)输出,然后在拖放后手动刷新,这样就可以正常工作 您的代码正在chrome v36.0.1985.143上运行。 将产品拖动到.droppable区域后,页面将按预期刷新 无论如何,请尝试将代码更新为: window.location

我正在创建一个更新数据库的装瓶日历。但我在可拖动和可拖放功能方面遇到了一些问题。我希望在我将装瓶从一个日期拖到另一个日期后重新加载屏幕,但无论何时我放入location。重新加载(true)如果我获取location,这将停止已删除的函数的工作。重新加载(true)输出,然后在拖放后手动刷新,这样就可以正常工作


您的代码正在chrome v36.0.1985.143上运行。 将产品拖动到.droppable区域后,页面将按预期刷新

无论如何,请尝试将代码更新为: window.location=“”; 而不是


window.location.reload(true)

删除php标记,因为这与php无关。如果我犯了错误,请更新您的问题,使其包含有问题的PHP代码,并阅读在Chrome中似乎对我有用的标记。我想我可以让所有的用户都使用它。
$(function() {
    $( ".draggable" ).draggable();
    $( ".droppable" ).droppable({
        drop: function( event, ui ) {
        // $( this ).addClass( "ui-state-highlight" ).find( "p" ).html( "Dropped!" ); 

            var droppableId = $( this).attr("id");

                   var draggableId = ui.draggable.attr("id");
                    var objText = ui.draggable.text(); 

              $.post("update_bottling.inc.php",
               {
                dbID:draggableId,
                newDate:droppableId,
                prodId:objText
              },
              function(data,status){
               // alert("Data: " + data + "\nStatus: " + status);
              });

              location.reload(true);  // reloads the screen this isn't working
        }  // ends the drop function

    }); // ends the droppable function

    $(".draggable").click(function(){
        var dragId = $(this).attr('id');
        var prodId = $(this).text();


              $.post("details.inc.php",
              {
                date:dragId,
                productId:prodId
              },
              function(data){
                $('#details').html(data);
              });     
    });  // end the draggable click function

});  // ends the on ready function