You need to include jquery first. Use this to code to include jquery require(['jquery'], function($){ //your code to send ajax request here
$.ajax({ showLoader: true, url: "admin/PostaPlus/PostaPlusShipping/HSCodes", data: param, typedo it: "POST",
dataType: 'json' }).done(function (data) { alert(data); console.log(data); });
Here is my custom controller codes,
});
require([
"jquery"
], function ($) {
//your code to send ajax request here
$.ajax({
showLoader: true,
url: "admin/PostaPlus/PostaPlusShipping/HSCodes",
data: param,
type: "POST",
dataType: 'json'
}).done(function (data) {
alert(data); console.log(data);
});
});