Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/javascript/406.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
facebook共享使用php和javascript生成白色/空白页面_Javascript_Php_Html_Facebook - Fatal编程技术网

facebook共享使用php和javascript生成白色/空白页面

facebook共享使用php和javascript生成白色/空白页面,javascript,php,html,facebook,Javascript,Php,Html,Facebook,好的,基本上,当我尝试使用facebook共享按钮时,我得到了一个白色页面,包括新版本和sharer.php版本 我正在尝试共享一个url,如下所示: **.com/3e68ec7f58134f66d09a1c05c2783385/index.html 现在,如果我粘贴到一个新的浏览器窗口中,或者刷新白色/黑色页面时,页面加载良好 这是我的密码: <!DOCTYPE html> <html> <head> <style type="text/css"&g

好的,基本上,当我尝试使用facebook共享按钮时,我得到了一个白色页面,包括新版本和sharer.php版本

我正在尝试共享一个url,如下所示: **.com/3e68ec7f58134f66d09a1c05c2783385/index.html

现在,如果我粘贴到一个新的浏览器窗口中,或者刷新白色/黑色页面时,页面加载良好

这是我的密码:

<!DOCTYPE html>
<html>
<head>
<style type="text/css">
body {
    overflow:hidden;
}
</style>
<link rel="stylesheet" href="onlinedojo/css/layout.css" type="text/css" media="screen" />
<script src="js/jquery-1.5.2.min.js" type="text/javascript"></script>
<script src="onlinedojo/js/hideshow.js" type="text/javascript"></script>
<script src="onlinedojo/js/jquery.tablesorter.min.js" type="text/javascript">    </script>
<script type="text/javascript" src="onlinedojo/js/jquery.equalHeight.js"></script>
<title>post</title>
</head>
<body>
<div id="fb-root"></div>
<script>
function postToFb(){
window.open('<?php echo $fburl ?>','1317220786706','width=400,height=400,toolbar=0,menubar=0,location=0,status=1,scrollbars=1,resizable=1,left=0,top=0');
    window.close();
    return false;
}
</script>
<form class="submit_link" style="float:right">
                &nbsp;<input type="submit" class="alt_btn"     value="Share on Facebook" onclick="postToFb();" />
            </form>
</body>
</html>

身体{
溢出:隐藏;
}
邮递
函数postToFb(){
打开(“”,'1317220786706','width=400,height=400,toolbar=0,menubar=0,location=0,status=1,scrollbars=1,resizeable=1,left=0,top=0');
window.close();
返回false;
}
任何帮助都将不胜感激-这让我发疯

好吧,你试试这个

<script>
    function postToFb(url) {
        window.open(url, '_blank', 'width=530,height=460,left=' + (screen.availWidth / 2 - 250) + ',top=' + (screen.availHeight / 2 - 250) + '');
        return false;
    }

<?php 
    $title = urlencode('your title');
    $summary = urlencode('your sumary');
    $url_base = urlencode('url to share');
    $url_image = urlencode('thumbnail url');
    $url_to_share = "http://www.facebook.com/sharer/sharer.php?s=100&p[title]=$title&p[summary]=$summary&p[url]=$url_base&p[images][0]=$url_image";
?>

postToFb('<?php echo urlencode($url_to_share) ?>') {

</script>

函数postToFb(url){
window.open(url,'.'空白','宽度=530,高度=460,左='+(screen.availWidth/2-250)+',顶部='+(screen.availHeight/2-250)+';
返回false;
}
postToFb(“”){

我希望这对您有所帮助。

您不需要此处的表单或提交按钮。因此,只需删除表单和按钮,并放置简单的共享链接,然后尝试此操作

HTML:

<a href="javascript: void(0)" onClick="fbpopup('<?php echo urlencode($fburl); ?>')">
 Share on Facebook
</a>

Javascript

<script>
function fbpopup(popwhat) {
window.open( popwhat, "fbshare", "height=380,width=660,resizable=0,toolbar=0,menubar=0,status=0,location=0,scrollbars=0" )
} 
</script>

功能fbpopup(popwhat){
打开(popwhat,“fbshare”,“高度=380,宽度=660,可调整大小=0,工具栏=0,菜单栏=0,状态=0,位置=0,滚动条=0”)
}