【发布时间】:2011-03-29 02:49:52
【问题描述】:
我需要给某人一个 facebook like 按钮。现在,这通常很容易(使用 facebook 的带有 iframe 的 API 的 hackjob),但是,他/她希望它出现在 Ebay 页面上。我该怎么办? Ebay 似乎不允许在卖家页面上使用 Javascript,所以,也许是一个静态按钮,一个 php 脚本更新(不知何故)?
【问题讨论】:
标签: php javascript facebook
我需要给某人一个 facebook like 按钮。现在,这通常很容易(使用 facebook 的带有 iframe 的 API 的 hackjob),但是,他/她希望它出现在 Ebay 页面上。我该怎么办? Ebay 似乎不允许在卖家页面上使用 Javascript,所以,也许是一个静态按钮,一个 php 脚本更新(不知何故)?
【问题讨论】:
标签: php javascript facebook
eBay 不允许 iframe 或 javacsript。
这就是为什么这家名为 3DSellers 的公司附带了 ShareYourItems 应用程序,该应用程序使用 Flash 插入 Share & Like 按钮(这是允许的): http://www.3dsellers.com/products/share-your-items/
【讨论】:
我不太了解 ebay 基础架构,但也许您可以使用开放图形 API。 供你参考: http://developers.facebook.com/docs/opengraph/
【讨论】:
这里是 Facebook 生成器http://developers.facebook.com/docs/plugins/的地方
确定您在 Dream weaver 中开始时的代码如下所示:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Untitled Document</title>
</head>
<body>
</body>
</html>
好的,当您添加从 facebook 生成的 HTML5 代码的第一部分时,您的代码应该类似于以下内容:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Untitled Document</title>
</head>
<body>
<div id="fb-root"></div>
<script>(function(d, s, id) {
var js, fjs = d.getElementsByTagName(s)[0];
if (d.getElementById(id)) return;
js = d.createElement(s); js.id = id;
js.src = "//connect.facebook.net/en_US/all.js#xfbml=1";
fjs.parentNode.insertBefore(js, fjs);
}(document, 'script', 'facebook-jssdk'));</script>
</body>
</html>
好的,然后代码的第二部分被插入,它应该看起来像这样,除了你的信息:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Untitled Document</title>
</head>
<body>
<div id="fb-root"></div>
<script>(function(d, s, id) {
var js, fjs = d.getElementsByTagName(s)[0];
if (d.getElementById(id)) return;
js = d.createElement(s); js.id = id;
js.src = "//connect.facebook.net/en_US/all.js#xfbml=1";
fjs.parentNode.insertBefore(js, fjs);
}(document, 'script', 'facebook-jssdk'));</script>
</body>
</html>
<div class="fb-send" data-href="http://example.com"></div>
将整个代码从 Dreamweaver 复制到 html 选项卡下的 ebay 列表顶部。
【讨论】:
Ebay 是否允许 iframe? 然后你可以实现like按钮的iframe-variant。
查看此处并从生成的源代码中复制纯 iframe-tag: http://developers.facebook.com/docs/reference/plugins/like/
【讨论】:
好的,我已经在 Dreamweaver cs 6 中完成了这项工作。
在 ebay 上提交列表
我什至在我的代码中添加了一个 swf flash 电影并且工作正常。我的商店页面和列表上有一个 Facebook 赞按钮,以及我的商品的自动播放 Flash 幻灯片。全部免费,没有第三方应用程序。 附言所有图片或 Flash 电影都必须在第三方主机站点上才能正常工作。 你可以查看我的网站www.mojotrading.biz,那里会有链接引导你到我的 ebay 页面,向你展示它的样子。
【讨论】: