php - AJAX Failing when fetching data from another server -
i read ajax not work remote found solution still facing how pure ajax, guide?? searched lot , tried methods, did not get. when using same ip , fetching data ,its working warning,but when giving server ip, not fetch .
function tooltipajax(r_id) { if (window.xmlhttprequest) { // code ie7+, firefox, chrome, opera, safari xmlhttp=new xmlhttprequest(); } else { // code 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 local server ip warning cannot modify header information - headers sent (output started at
but not working server ip..
Comments
Post a Comment