0

I'm using XMLHttpRequest() to send an xml request to asp classic page. The same request returns the expected response (response = "Response received") when server.asp is on localhost, but not when it is on my godaddy website.

When I googled I found that it's because of crossdomain, but I couldn't find a solution for it.

I tried the same with $.ajax with same result.

Javascript:

var xmlhttp = new XMLHttpRequest();
xmlhttp.open("POST", "http://www.myserver.com/server.asp", false);
xmlhttp.setRequestHeader("Content-Type", "text/xml; charset=utf-8");
xmlhttp.send("<xml/>");
var response = xmlhttp.responseText;

server.asp

Response.Write ("Response received")
coder
  • 4,121
  • 14
  • 53
  • 88
  • check this: [Using CORS](http://www.html5rocks.com/en/tutorials/cors/) – Flakes Dec 10 '15 at 13:07
  • Kindly refer [http://stackoverflow.com/questions/17874730/how-to-make-cross-domain-request](http://stackoverflow.com/questions/17874730/how-to-make-cross-domain-request) – Hardipsinh Jadeja Jan 07 '16 at 13:02

0 Answers0