为什么fancybox没有加载我的页面?

时间:2012-11-14 16:23:10

标签: php javascript jquery fancybox hybridauth

fancybox的这个问题让我发疯了。单击该链接时,加载图标将一直显示,并且不显示任何页面。我测试了几件事,但我不知道为什么会这样。

它只发生在特定类型的页面上,而且它是我用来向facebook注册用户的那个(我在内部使用hybridauth)。他们应该在facebook网站上被要求授权,但是没有。但是,当然,如果您正常打开链接,没有fancybox,它就可以正常工作。

我做了一个问题的实例,你可以自由地探索它。 Live test

如果您需要更多信息,我非常感谢您的帮助。 谢谢。

编辑: 这是register.php源代码:

<?php
session_start();

error_reporting(E_ALL);
ini_set('display_errors', 'On');

$config = dirname(__FILE__) . '/hybridauth/hybridauth/Hybrid/config.php';
require_once( "hybridauth/hybridauth/Hybrid/Auth.php" );

try{
    $hybridauth = new Hybrid_Auth( $config );

    switch($_GET["s"]){

        case "facebook":
            $facebook = $hybridauth->authenticate( "Facebook" );
            $facebook_user_profile = $facebook->getUserProfile();

            echo "<pre>";
            print_r( $facebook_user_profile );
            echo "</pre>";
    }

} catch(Exception $e){
    // Display the recived error,
    // to know more please refer to Exceptions handling section on the userguide
    switch( $e->getCode() ){
        case 0 : echo "Unspecified error."; break;
        case 1 : echo "Hybriauth configuration error."; break;
        case 2 : echo "Provider not properly configured."; break;
        case 3 : echo "Unknown or disabled provider."; break;
        case 4 : echo "Missing provider application credentials."; break;
        case 5 : echo "Authentification failed. "
        . "The user has canceled the authentication or the provider refused the connection.";
        break;
        case 6 : echo "User profile request failed. Most likely the user is not connected "
        . "to the provider and he should authenticate again.";
        $twitter->logout();
        break;
        case 7 : echo "User not connected to the provider.";
        $twitter->logout();
        break;
        case 8 : echo "Provider does not support this feature."; break;
    }

    // well, basically your should not display this to the end user, just give him a hint and move on..
    echo "<br /><br /><b>Original error message:</b> " . $e->getMessage();
}

2 个答案:

答案 0 :(得分:0)

您的register.php正在返回:

http://www.andsheep.com/dev/tests/live/BS_tests/hybridauth/hybridauth/?hauth.start=Facebook&hauth.time=1352910122&r=

你也有:dirname(__FILE__)在一行,但不在另一行。

$config = dirname(__FILE__) . '/hybridauth/hybridauth/Hybrid/config.php';
require_once( "hybridauth/hybridauth/Hybrid/Auth.php" );

无论如何,现在我在facebook链接上收到一个.htpasswd登录框...

答案 1 :(得分:0)

我认为问题可能是facebook阻止了iframe的身份验证对话框。