I'm using jquery ajax , to call the rest api of Rundeck
like
$.ajax(
{
url:"{rundeck_url}/api/1/job/5?authtoken=D4CUK8DD5DP4sovSR7p9UUnd5DnvU3do"
}
);
but get error from brower for doing an XMLHttpRequest to a different domain
XMLHttpRequest cannot load {rundeck_url}/api/1/job/5?authtoken=D4CUK8DD5DP4sovSR7p9UUnd5DnvU3do. No 'Access-Control-Allow-Origin' header is present on the requested resource. Origin '{site_url}' is therefore not allowed access.
what I need to do is something different when you want to do a cross-domain request. A tutorial about how to achieve that is Using CORS.
Is there any config to set up the header for Cross-Origin ?
Thanks