How to create your OWN button? (Non-Facebook related)

I looked at SO here in several other places and ... slurred.

What is the structure of the Facebook โ€œLikeโ€ Button found on all websites?

Is it a social bookmark, a kind of browser button?

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

How to create and implement a Like button?

I want my own button with the same functionality as FB, but NOT connected or developed on their platform! I am trying to inject this into iWeb'09 as an html widget.

+4
source share
3 answers

To answer your question, think about what happens with the buttons, and then go into similar buttons.

  • Pressing a button triggers an event on the client that may or may not update the server somewhere to notify that the button has been pressed for such and such an intention. You can send a lot of additional information with this event, for example, when and where who and why, etc.
  • Buttons like these usually contain additional information about who likes it and what they like. To get this, you can ask people to log in or provide some input to identify them.

Take an example of a real world similar button that you can implement in javascript using any server-side technology.

  • Anyone who installs your script will be able to see the button. You can form it using any css or your javascript can just load the iFrame from your server or add elements to the DOM to display this button.
  • When you click on it, your server is called with information about the user, or at least the URL of the page where it was called. For example, Google Analytics uses a unique identifier associated with a domain URL to track visitors.
  • when you receive this call, you can update your database / repository or something with a note that the button on the abc site has been clicked, so update their likes or dislikes.
  • If you want your javascript to also increase the number on the same page before or after updating your server.
  • When someone else visits this site, the script downloads and sends a request to your server again so that you can update the account on the page, but this time the user does not press the type / dislike button, so you are not updating the record.
  • Then you can show it as a pie chart for the user when they visit their site or page with the separation of people who liked it and people who did not report (did not click the button).

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

+1
source

You must first have a database in which you can store various values. Now, whenever a user clicks a button, the value of the button stored in the database should be increased. To do this, you will need a base language that will connect you to the SQL database. Therefore, whenever a button is pressed, the meaning of the icons in the database changes.

0
source

I have done this successfully. Here is how I did it:

You have a table in the database called "likes" with the username, postid (as well as the date, id, if you want too)

Each post / blog / article must have its own identifier.

When someone likes a post / blog / article, you take the id of the post / article / article and the username that you liked , and check the likes of the database to see if it exists. If it already exists, you delete it. If it does not exist, you add similar.

For example, with AJAX, thatโ€™s how I did it specifically:

I have a blog post with id 6.

Jonathan likes this post.

These 2 variables are sent via the mail form and wait for a response, she likes the logical check of the database to see if this record already exists in the table tables (username, postid) ('Jonathan', 6 ), if the answer is 1 (or true ), then I update the div number for the like button from any value that was originally, and add 1. If the answer is 0 (or false), then I take the original value in the counter I like and delete 1.

0
source

All Articles