JQuery AJAX POST - no data sent

$.ajax({
    url: "/Configuration/AddServersAdvancedSelect",
    type: "POST",
    data: { selectedOUs: that.getByDataSelected() },
    async: false,
    dataType: "html",
    success: result => {
        cont.setTabContentFromHtmlString(result, 1);
        cont.tabClicked($("td[data-value='1']").get(0));
    },
    error: (xhr, ajaxOptions, thrownError) => {
        //
    }
});

EDIT: I got back to work today and it magically started working. I guess something

This is my ajax request to the server. For some reason, data is not selected. The getByDataSelected function works as it should, and returns useful values. The Controller method is named selectedOU and everything matches. Does anyone know why this ajax POST is not sending data?

+4
source share
1 answer

jQuery defines a data parameter as

Type: PlainObject or String or Array

, . , . URL- GET. . processData .

"/" .

, jQuery ( ).

, this.getByDataSelected() , .

[500]

+1

All Articles