AJAX call not initializing for non-admins in WordPress

There are several potential reasons for this issue: Permissions: Non-admin users may not have the necessary permissions to access the admin-ajax.php file, which is being called in your AJAX request. Make sure that the required permissions are set for the user roles other than admin. Authentication: Non-admin users may not be authenticated to access the … Read more

Bad Request 400… jQuery ajax post of json data to wordpress admin-ajax.php

To elaborate on my comments, your issue is here: contentType: ‘application/json; charset=utf-8’, data: JSON.stringify({ action: ‘cdnjs_add_library’, library: library }), When sending data to admin-ajax.php you need to set the action property of data to the action name, eg. cdnjs_add_library. That’s not what you’re doing here. data is not an object with an action property, as … Read more

how can i create get request unis ajax without expecting return value

i have correct my Code and it works now. Order.prototype._downloadDetails = function () { var sServiceUrl = _oController.getServiceUrl(); let iRoleId = _oController.getRoleId(); let iObjectId = _oController.getObjectId(); if (sServiceUrl && iRoleId && iObjectId) { window.open(sServiceUrl +”/download?” + “roleId=” + iRoleId + “&objectId=” + iObjectId, ‘_blank’).focus() } };