我一直在使用 jquery $.post 在 opencart 上编写脚本。
$(document).ready(function() {
$(function() {
$("#contentLeft ul").sortable({
opacity: 0.6,
cursor: 'move',
update: function() {
var order = $(this).sortable("serialize") + '&action=updateRecordsListings';
$.post("updateDB.php", order, function(theResponse) {
$("#contentRight").html(theResponse);
});
}
});
在 opencart 中,我在模型中创建了一个函数,该函数包含 updateDB.php 中应该包含的内容,我希望调用此函数而不是外部页面(updateDB.php),并且无需重新加载当前页面。
也许 .post 不是我应该使用的,或者是吗?
任何想法将不胜感激。