You need to use the Mendix JavaScript Client API to do this. Have a look at the mx.data.get method.
For example, to get all the System.User objects, you can use the following...
mx.data.get({
xpath: "//System.User",
callback: function(objs) {
console.log("Received " + objs.length + " MxObjects");
}
});
https://apidocs.rnd.mendix.com/9/client/mx.data.html
I hope this helps. Good luck!