This doesn't work for me. This is the error I now get after adding sending POST to the server
XMLHttpRequest cannot load http://url.com?action=test. No 'Access-Control-Allow-Origin' header is present on the requested resource. Origin 'http://localhost:8100' is therefore not allowed access.