为什么尝试在加载时对类进行 ajax 调用会因多个元素而失败?

问题描述 投票:0回答:1
javascript jquery ajax
1个回答
0
投票

load
不支持
td
元素,您可以在 here 阅读有关支持元素的更多信息。

在你的情况下,你可以使用JQuery的文档准备文档加载

    $(document).ready(function () {
    const site = $(".ajax-delsite").data("site");
    $.ajax({
        url: "/ajax/remove-site.php",
        type: "POST",
        data: { site: site },
        success: function (feedback) {
            $("#ajaxResult").html(feedback);
        }
    });
});

© www.soinside.com 2019 - 2024. All rights reserved.