我正在使用jquery sortable / serialize重新排序并在两个列表之间移动项目,我已经多次重复使用代码并且从未遇到过问题。我刚刚意识到如果我尝试在listItem数组中传递超过142个元素,它就不会调用reorder.php函数。
我似乎无法在谷歌上找到有关最大数量项目的任何内容。
这是我的javascript:
<script type="text/javascript">
$(document).ready(function() {
$("#listLive, #listHidden").sortable({
connectWith: '.connectedSortable',
update : function () {
var order = $('#listLive').sortable('serialize');
$("#resultLive").load("reorder.php?"+order+"&live=1&table=<?=$thing?>");
var order = $('#listHidden').sortable('serialize');
$("#resultHidden").load("reorder.php?"+order+"&live=0&table=<?=$thing?>");
}
});
});
</script>
以下是reorder.php看到我是否执行print_r($ _ GET);列表数组中有142个元素。如果我将143号拖入列表中,则无响应...
Array ( [listItem] => Array ( [0] => 52 [1] => 51 [2] => 54 [3] => 53 [4] => 55 [5] => 57 [6] => 56 [7] => 58 [8] => 59 [9] => 60 [10] => 61 [11] => 62 [12] => 63 [13] => 64 [14] => 65 [15] => 66 [16] => 67 [17] => 68 [18] => 69 [19] => 70 [20] => 71 [21] => 72 [22] => 73 [23] => 74 [24] => 75 [25] => 76 [26] => 77 [27] => 78 [28] => 79 [29] => 80 [30] => 81 [31] => 82 [32] => 83 [33] => 84 [34] => 85 [35] => 86 [36] => 87 [37] => 88 [38] => 89 [39] => 90 [40] => 91 [41] => 92 [42] => 93 [43] => 94 [44] => 95 [45] => 96 [46] => 97 [47] => 98 [48] => 99 [49] => 100 [50] => 101 [51] => 50 [52] => 49 [53] => 48 [54] => 47 [55] => 46 [56] => 45 [57] => 44 [58] => 43 [59] => 42 [60] => 41 [61] => 40 [62] => 39 [63] => 38 [64] => 37 [65] => 35 [66] => 34 [67] => 33 [68] => 32 [69] => 31 [70] => 30 [71] => 29 [72] => 28 [73] => 27 [74] => 26 [75] => 139 [76] => 25 [77] => 23 [78] => 22 [79] => 21 [80] => 20 [81] => 19 [82] => 18 [83] => 17 [84] => 16 [85] => 15 [86] => 14 [87] => 24 [88] => 13 [89] => 12 [90] => 11 [91] => 10 [92] => 9 [93] => 8 [94] => 7 [95] => 6 [96] => 5 [97] => 4 [98] => 3 [99] => 137 [100] => 103 [101] => 102 [102] => 104 [103] => 105 [104] => 106 [105] => 107 [106] => 108 [107] => 109 [108] => 110 [109] => 111 [110] => 141 [111] => 112 [112] => 113 [113] => 114 [114] => 115 [115] => 116 [116] => 135 [117] => 117 [118] => 118 [119] => 119 [120] => 120 [121] => 121 [122] => 122 [123] => 123 [124] => 124 [125] => 140 [126] => 125 [127] => 126 [128] => 127 [129] => 128 [130] => 136 [131] => 129 [132] => 130 [133] => 131 [134] => 138 [135] => 132 [136] => 133 [137] => 134 [138] => 142 [139] => 143 [140] => 144 [141] => 145 ) [live] => 1 [table] => gallery )
是否存在某种最大数量的元素?如果是这样的话,142似乎有点奇怪!
答案 0 :(得分:2)
它不是大约142个项目,而是您尝试加载的网址长度。
当你做&#39; +订购&#39;你超过了最大字符数。
我建议您通过ajax执行POST请求,而不是键入URL中的所有项目。