Php AJAX调用在Chrome中返回Object,但在Firefox和IE中返回Null

Php AJAX调用在Chrome中返回Object,但在Firefox和IE中返回Null,php,jquery,ajax,Php,Jquery,Ajax,我的AJAX调用在Chrome中运行良好,但当我在Firefox或IE中测试它时,我收到一个空响应。非常感谢您的帮助 我的PHP函数: function get_ldap_attr() { $lan = $_POST['lan']; $dn = get_site_option ( "ldapServerOU" ); $usr = get_site_option ( "ldapServerCN" ); $pw = get_site_option ( "ldapSe

我的AJAX调用在Chrome中运行良好,但当我在Firefox或IE中测试它时,我收到一个空响应。非常感谢您的帮助

我的PHP函数:

function get_ldap_attr() {

    $lan = $_POST['lan'];
    $dn = get_site_option ( "ldapServerOU" );
    $usr = get_site_option ( "ldapServerCN" );
    $pw = get_site_option ( "ldapServerPass" );
    $addr = get_site_option ( "ldapServerAddr" );
    $ad = ldap_connect ( $addr )
        or die ( "Connection error." );
    ldap_set_option ( $ad, LDAP_OPT_PROTOCOL_VERSION, 3 );
    ldap_set_option ( $ad, LDAP_OPT_REFERRALS, 0 );
    $bind = ldap_bind ( $ad, $usr, $pw );

    if ( $bind ) {
        $SearchFor ="cn=".$lan;
            $result = ldap_search ( $ad,$dn,$SearchFor );
            $entry = ldap_first_entry ( $ad, $result );
            if ( $entry != false )  {
                $info = ldap_get_attributes ( $ad, $entry );
            }           
            $comm  = stripos ( $info['manager'][0], ',' );
                // find position of first comma in CN=Mxxxxxx,OU=Users,OU=MCR,DC=mfad,DC=mfroot,DC=org  (directReports field)
            $eq = stripos ( $info['manager'][0], '=' );
                // find position of first =
            $s_lanid = substr ( $info['manager'][0], $eq+1, ( ( $comm-1 ) - ( $eq ) ) );
                //get substring between = and comma...
            $sup = getLDAPInfo ( $s_lanid, $bind, $ad, $dn ); 
                // get supervisor's info...
            $subInfo = getLDAPInfo ($lan, $bind, $ad, $dn);
    }
    echo json_encode( array( $sup, $subInfo ) );
    die();
}
我的jQuery:

jQuery(function() {

    jQuery('#empLanId').on('blur', function() {
    var lan = jQuery('#empLanId').val(),
        data = { action: "get_ldap", lan: lan};
        jQuery.ajax({
            type: 'POST',
            url: ajaxurl,
            data: data,
            dataType: 'json',
            success: function(response) {
                console.dir(response);

                jQuery('#empName').val(response[1].fullname);
                jQuery('#empSupLanId').val(response[0].lanid);
                jQuery('#empSupName').val(response[1].fullname);
                jQuery('#empSupNumber').val(response[1].phone);
            }

        });
    });
});

查看您的网络选项卡,看看浏览器之间的响应是否有任何差异。jQuery的哪个版本?PHP中$sup的print\r()是什么?您确定AJAX调用中使用的URL和数据在所有浏览器中都是相同的吗?print\r()返回正确的对象。我的公司正在运行jQuery 1.7.1