i want to load domain https://api.jqueryui.com/dialog/ with load function or $.ajax function but this give me error :
Access to XMLHttpRequest at 'https://api.jqueryui.com/dialog/' from origin 'null' has been blocked by CORS policy: Response to preflight request doesn't pass access control check: No 'Access-Control-Allow-Origin' header is present on the requested resource.
here my code:
$("body").load('https://api.jqueryui.com/dialog/');
also tryed this code:
$.ajax({
xhrFields: {
withCredentials: true
},
headers:{
"Access-Control-Allow-Origin": "*"
},
crossDomain: true,
type: "GET",
url: "https://api.jqueryui.com/dialog/",
}).done(function (data) {
$('body').append(data);
});