skip to Main Content

Can not pass parameters from JQuery AJAX to controller

I am calling a method in JQuery like this var data = { 'minAge': minAge, 'MaxAge': maxAge, 'ProductType': ProductType, 'ProductSubject': ProductSubject, 'ordering': '@Ordering.NotOrder', 'Searchkey': "", 'CatId': @Context.Request.Query["CatId"] } $.ajax({ contentType: 'application/x-www-form-urlencoded', dataType: 'json', type: "POST", url: '/ApplyFilter', data: data, success:…

VIEW QUESTION

WordPress admin-ajax.php 400 (Bad Request) error

I am trying to call a php function with a button press. This is my code so far: echo("<button onclick="import_file()"> Import </button>"); The Javascript upload.js file: function import_file () { jQuery.ajax({ url: my_ajax_object.ajax_url, data: {action: 'final_save'}, type: "POST", //request type…

VIEW QUESTION
Back To Top
Search