xml request gets convert to text/html request and causing 500 internal server error?



i am sending a ajax request and expecting xml response but the response gets converted to text/html .It is causing 500 internal server error too.the same code is working on my localhost. enter image description here


below is a small code which shows how i am sending the request



var searchUrl = '<?php bloginfo('template_url'); ?>/phpsqlsearch_genxml-new-home-page.php?address=' + address + '&postal_code=' + postal_code + '&radius=' + radius + '&suggestion=' + suggestion;
downloadUrl(searchUrl, function(data) {
var xml = parseXml(data);
var markerNodes = xml.documentElement.getElementsByTagName("marker");
var bounds = new google.maps.LatLngBounds();
if (markerNodes.length == 0) /////////////check empty result/////////////
{
var msg = jQuery("<div/>").html("aucun r&eacute;sultat trouv&eacute;").text();
alert(msg);

displayAllStoresOfbrands();
}


and below is the code of the file i am hitting my ajax request



<?php header("Content-type: text/xml");


above is the code which i have placed on the top of my ajax file


No comments:

Post a Comment