This is a little REST / JQuery demo. Please look at the source code. Disclaimer: We didn't take time to understand CORS. It looks very counterintuitive to us. E.g. it is difficult to understand why the target server (and only he) has to give persmission to a html file to use its data. I'd say that this server also should restrict the servers where data can come from.

This example only can work if the HTML file sits on the same machine as the target server (where the REST request is submitted) or if your servers have been configured to allow "CORS headers". Configuration:

Query results

Resources used: