0

I read AJAX does not work with remote but found solution but still facing How to do it with Pure AJAX, Any guide?? I searched a lot and tried some methods, but did not get. When I am using same IP and fetching data ,its working with warning,but when giving another server IP, it does not fetch .

function tooltipajax(r_ID) {
    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() {
        if (xmlhttp.readyState==4 && xmlhttp.status==200) {
            document.getElementById('span'+ r_ID).innerHTML = xmlhttp.responseText;
        }
    }

    xmlhttp.open("GET","http://ip here/common/accounteditajax.php?key=" +r_ID,true);
    xmlhttp.send();
} 

I tried HEADER

header("Access-control-Allow-Origin: http://IP HERE/common/");

it worked for local server with ip with warning Cannot modify header information - headers already sent by (output started at

But not working with another server ip..

Mike
  • 2,132
  • 3
  • 20
  • 33

0 Answers0