return xml in jquery ajax return xml in jquery ajax ajax ajax

return xml in jquery ajax


This is working fine

Post.php file

if($_GET['id']!=""){        $array = array('satyam'  => 'satyam',                   'class'   => 'B.TECH',                   'company' => 'Ranosys');}   $new ='<?xml version="1.0" encoding="iso-8859-1"?><data>';foreach($array as $key => $values){     $new .= "<$key>$values</$key>";}echo $new.'</data>';=================function load_data(){    $.ajax({        url: "post.php",        async: false, // stop browser for another activity        data: "id=satyam",        // dataType :'xml',        error: function(e, b, error) {             for(var i in e){              // alert(i);            }            alert(e.respone);        },        success: function(msg) {            //alert($response);            var data = $(msg).find("satyam").text();            alert(data);        }    });}


Try this: var data = $(xml).find('doctor').text()

In your example, 'xml' is not a jQuery object.


You need to parse this XML (I really don't understand why , but...), you can do it by do:

$(xml).find('doctor').text();

Bye. :)