An error was encountered while attempting to access the rest server from a Web front-end using an HTTP request request: XMLHttpRequest cannot load http://localhost:8080/ping. No ' Access-control-allow-origin ' header is present on the requested resource. Origin ' http://localhost:63342 ' is therefore not allowed access.
This error is caused by the Ajax cross-domain access to another domain's service, which in general can be handled by using JSONP, which is to pass a callback function to the server side, and then wrap the callback function on the server side to the outside of the JSON object and return it to the client. However, JSONP only takes effect on get requests, does not take effect on post, PUT, delete, and because JSON itself is inherently unsafe (see this link), many clients use post to get the JSON response. So now a lot of the use of cors (see Wiki link for details), is actually very simple, just need to add a header to your server response header, ("Access-control-allow-origin", "Http://domain") Can be solved, the standard is supported by most browsers, including the mobile side.
JavaScript cross-domain access to cors issues