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.
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ésultat trouvé").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