Avatar of TrueBlue
TrueBlueFlag for United States of America

asked on 

adding a facebook like button

Hi!
What code would be needed to simply add a facebook like button and number of likes to our website? It is an ASP page.
TIA
ASPHTML

Avatar of undefined
Last Comment
harris9999
Avatar of Om Prakash
Om Prakash
Flag of India image

Avatar of TrueBlue
TrueBlue
Flag of United States of America image

ASKER

om_prakash_p

I was looking for simple code to just add a like button and # of likes similiar to what EE has on this page.
Avatar of harris9999
harris9999
Flag of United Kingdom of Great Britain and Northern Ireland image

Is it just the like button which will be individual to each page on your website?
In that case if you go to this link: http://developers.facebook.com/docs/reference/plugins/like/
you can grab the code there and customise it as you want.  

So for example:
<div id="fb-root"></div><script src="http://connect.facebook.net/en_US/all.js#appId=150218438386356&xfbml=1"></script><fb:like href="https://www.experts-exchange.com" send="true" width="450" show_faces="false" font=""></fb:like>
That would be appropriate if it is just to display for that url https://www.experts-exchange.com

If it is to be specific to a individial page or news story you can change that url in the code above as necessary.
You could also have it displayed where the url is generated automatically by the server variables:

<div id="fb-root"></div><script src="http://connect.facebook.net/en_US/all.js#appId=150218438386356&xfbml=1"></script><fb:like href="<%="http://" &  request.ServerVariables("HTTP_Host") &  request.ServerVariables("HTTP_X_REWRITE_URL")%>
" send="true" width="450" show_faces="false" font=""></fb:like>
Avatar of TrueBlue
TrueBlue
Flag of United States of America image

ASKER

harris9999,

This is the code I added to our home page:

    <script type="text/javascript" src="http://connect.facebook.net/en_US/all.js#xfbml=1"></script>

<div class="fbbutton">
      <fb:like href="http://www.topsecurityinc.com/" send="false" layout="button_count" width="90"      show_faces="false" font="arial"></fb:like>
</div>

But the FB counter is not displaying.
Any ideas would be appreciated?
Avatar of harris9999
harris9999
Flag of United Kingdom of Great Britain and Northern Ireland image

It looks ok on your website to me.
When I click the like button it displays a 1 beside it on your website.
Just that no one has liked it yet.  When you click on the Like button on your website does it not display the 1?
Avatar of TrueBlue
TrueBlue
Flag of United States of America image

ASKER

harris9999,
It does not display the value unless you click the like button.
EE shows the value without clicking the like button.
Any ideas?
ASKER CERTIFIED SOLUTION
Avatar of harris9999
harris9999
Flag of United Kingdom of Great Britain and Northern Ireland image

Blurred text
THIS SOLUTION IS ONLY AVAILABLE TO MEMBERS.
View this solution by signing up for a free trial.
Members can start a 7-Day free trial and enjoy unlimited access to the platform.
See Pricing Options
Start Free Trial
ASP
ASP

Active Server Pages (ASP) is Microsoft’s first server-side engine for dynamic web pages. ASP’s support of the Component Object Model (COM) enables it to access and use compiled libraries such as DLLs. It has been superseded by ASP.NET, but will be supported by Internet Information Services (IIS) through at least 2022.

82K
Questions
--
Followers
--
Top Experts
Get a personalized solution from industry experts
Ask the experts
Read over 600 more reviews

TRUSTED BY

IBM logoIntel logoMicrosoft logoUbisoft logoSAP logo
Qualcomm logoCitrix Systems logoWorkday logoErnst & Young logo
High performer badgeUsers love us badge
LinkedIn logoFacebook logoX logoInstagram logoTikTok logoYouTube logo