If I access server right through browser's address field, server successfully responds.
But when I try accessing it from my send.js script:
var request = new XMLHttpRequest();
request.open( 'GET', "myserver.com", true );
request.onreadystatechange = function ()
document.write( "received response: " + request.response );
document.write( "sending request ..." );
request.send( 'login=billy&password=sunshines' );
<title>Server send script TEST</title>
When you access the script directly by using the address bar there is no cross origin resource sharing taking place. Your browser navigated to
myserver.com so any request to
myserver.com is same-origin.
When your browser location is
http://192.168.0.101:8080, a request to
myserver.com is Cross-Origin because your browser location differs from the location to which you're making http requests.
You'll have to enable CORS on your backend or use JSONP.