Here is my code
<script>
function loadXMLDoc()
{
var xmlhttp;
if (window.XMLHttpRequest)
{// code for IE7+, Firefox, Chrome, Opera, Safari
xmlhttp=new XMLHttpRequest();
}
else
{// code for IE6, IE5
xmlhttp=new ActiveXObject("Microsoft.XMLHTTP");
}
xmlhttp.onreadystatechange=function()
{
var responseText = xmlhttp.status + xmlhttp.responseText;
document.getElementById("myDiv").innerHTML=responseText;
}
xmlhttp.open("GET","https://exmaple.com/public/onDemandDemo/Products?$top=2");");
xmlhttp.send();
}
</script>
when I tried to perform GET request I am getting **
"XMLHttpRequest cannot load https://https://exmaple.com/public/onDemandDemo/Products?$top=2. The 'Access-Control-Allow-Origin' header contains multiple values 'null, *', but only one is allowed. Origin 'null' is therefore not allowed access."
** error
But I am getting response when I used same url and header in requestmaker.com
please help as I am very new to javascript and AJAX.