I would not recommend doing it direct from a plain HTML page to Dataverse. Not least of which you have to authenticate with Dataverse, and in so doing expose a set of login credentials on your page.
The piece of code you have probably works if run inside a Dataverse form from a Web Resource (even with the deprecated Xrm.Page uasage), but wont work in a stand alone html page due to not authenticating and the Xrm object being provided from Dataverse (Note the Xrm usage in that code just dynamically gets a path to the Dataverse instance and the second usage is just to display something in a pop, these can be hard coded and substituted for a JavaScript alert() respectively.
But your XMLHttpRequest would need to be extended to include authentication.
Not 100% sure, but you may also need to change from GET to POST (Microsoft try to force the use of POST these days)