Error when trying to get crm record

Error when trying to get crm record

Usinf the CRM API, I'm trying to pull a record from our CRM by getRecordById, but I'm getting the following error:

No 'Access-Control-Allow-Origin' header is present on the requested resource. Origin 'https://www.w3schools.com' is therefore not allowed access.

The full code can be found here:
https://www.w3schools.com/code/tryit.asp?filename=FDFWZRMENMHV

Appreciate your help with this.