如何创建“喜欢”按钮? (与facebook无关) [英] How to create your OWN Like button? (Not facebook related)

查看:124
本文介绍了如何创建“喜欢”按钮? (与facebook无关)的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在这里看了其他几个地方& ……毫无头绪。



Facebook的 Like按钮的结构是什么?



这是一种社交书签,浏览器按钮类型吗?



是否有逐步的过程(不使用FB Api)来制作我自己的按钮。 / p>

如何设计和使用实施Like按钮?



我希望我自己的按钮具有与FB类似的功能,但在他们的平台上不相关或未开发!我试图在iWeb'09中将此输入为html小部件。

解决方案

要回答您的问题,请考虑按钮和按钮会发生什么。然后进入类似的按钮。


  1. 按下按钮会触发客户端上的事件,该事件可能会或可能不会更新某处的服务器以通知该按钮出于这种意图而被迫。您可以通过此事件发送很多额外的信息,例如何时何地,何时何地以及为什么等等

  2. 像按钮通常具有有关喜欢它的人以及喜欢什么的额外信息。为了使您可以要求人们登录或提供某种输入来识别他们。

以真实的例子为例可以使用任何服务器端技术在类似javascript中实现的类似按钮


  1. 无论安装脚本的人都可以看到该按钮。您可以使用任何CSS来形成它,或者您的javascript可以简单地从服务器中加载iFrame或将元素附加到DOM上以显示此按钮

  2. 单击时,它会使用人的信息或至少调用您的服务器调用它的页面URL。例如,谷歌分析使用与域URL相关联的唯一ID来跟踪访问者。

  3. 收到此呼叫后,您可以使用abc站点上的勾号按钮更新您的数据库/存储或任何内容已被按下,所以让我们更新他们的喜欢或不喜欢。

  4. 如果您希望JavaScript也可以在更新服务器之前或之后增加同一页面上的数字。

  5. 当其他人访问该站点时,脚本再次加载并发送请求到您的服务器,以便您可以更新页面上的计数,但是这次用户没有单击喜欢/不喜欢按钮,因此您不更新记录。 / li>
  6. 然后您可以将其显示为饼状图,以饼图的形式向用户显示其网站或页面的总访问量,并按喜欢它的人和不报告他们的人(没有按下按钮)进行划分。

如果您仍然想知道如何创建按钮。使用 CSS按钮生成器获取一个


I looked on SO, here, a few other places & ... cluelessness set's in.

What is the structure of the Facebook " Like " Button found all over websites ?

Is it a Social Bookmarking, Browser Button kind ?

Is there a step by step process (without using FB Api) to make my own kind of button.

How to design & implement a Like Button ?

I want my own button with similar functionality as FB but NOT related or developed on their platform! I am trying to input this in iWeb'09 as a html widget.

解决方案

To answer your question consider what happens with buttons and then go into like buttons.

  1. Pressing a button triggers an event on client which may or may not update a server somewhere to notify that a button has been pressed for such and such intention. You can send a lot of extra info with this event like when and where who and why etc
  2. Like buttons usually have extra info on who liked it and what they like. In order to get that you might ask people to sign in or provide some kind of input to identify them.

Take a real world example of a like button you can implement in say javascript using any server side technology

  1. Whoever install your script will be able to see the button. You may form it with any css or your javascript can simply load an iFrame from your server or append elements to DOM to show this button
  2. When clicked it calls your server with person's info or at least the page url where it was called. For example google analytics uses a unique ID associated with domain url to track visitors.
  3. when you recieve this call you can update your database/storage or anything with the tick mark that button on abc site has been pressed so lets update their likes or dislikes.
  4. If you want your javascript can also increment the number on the same page either before or after updating your server.
  5. When someone else visit that site the script again loads and send a request to your server so you can update the count on page but this time user does not click on like/dislike button so you dont update the record.
  6. You may then show it as a pie chart to user on total visits to their site or page with division in people who liked it and people who did not report back (did not press the button)

If you are still wondering how you can create a button . Use CSS button generator to get one

这篇关于如何创建“喜欢”按钮? (与facebook无关)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆