I'm pretty new to using JavaScript to perform requests, however I want to get the HTML of a page from https://www.halowaypoint.com but keep getting an error response of "XMLHttpRequest cannot load https://www.halowaypoint.com/en-us/players/PLAYER/halo4. No 'Access-Control-Allow-Origin' header is present on the requested resource. Origin 'URL' is therefore not allowed access." (PLAYER has been substituted).
I've heard CORS being mentioned several times after looking around, but I don't have server side access and I'm not sure how to reflect this in the request. Is there a way around this?
This is the code I've used so far:
$.ajax({
type: 'get',
url: 'https://www.halowaypoint.com/en-us/players/PLAYER/halo4',
dataType:'text',
contentType: 'text/plain',
xhrFields: {
withCredentials: false
},
headers: {
},
success: function(data) {
alert(data)
},
error: function() {
alert('Error')
}
});
Thanks!