It seems that social buttons (Facebook,Google,Twitter) usually are put in an iframe. It seems I can isolate the social button by following the iframe source URL, for example a tweet button:
Follow this URL to see the tweet button
My question is: How do I put this button on my page? The reason I want it out of the Iframe is because I would like to click on it programmatically eg Jquery/javascript.
This is not possible by design, and besides that against the TOS of these services. You cannot post on an arbitrary user's facebook or twitter without their approval.
Related
I've made a email template in HTML for Outlook and it includes a button, when the user clicks the button it navigates to a website. I'm trying to hide the URL link when the user hovers over it.
When I test the template using Google Chrome the URL doesn't appear and when you click on the button it goes to the website but when I send the template in Outlook, you can't see the link when you hover over it but when I click on the button it doesn't go to the website.
I'm fairly new at this, so was wondering it anyone could help. The code I'm currently using is:
<a onclick="location.href='IP Address'">Click here</a>
This is impossible (thankfully, since support for this would be a great boon to phishers).
Email clients that accept HTML formatted mail do not accept JavaScript.
Similar to this medium article where a custom og:image, og:title, and og:description are displayed for different articles, when the facebook share button is clicked a popup opens to let the user type a message and below is the image/title/description grabbed from meta tags (og:image, og:title, etc)
When the user clicks on the facebook share button I then dynamically change the meta tags to customized images/descriptions using javascript like so
document.head.querySelector("[property='og:image']").setAttribute("content", image_url)
the problem is that the image isn't appearing at all when the fb share button is clicked - when I enter the url into Sharing debugger it works, but on the actual website it doesn't
Not certain what your aim is but you won't be able to set the og:image using Javascript because facebook is getting the image url etc. from the HTML returned by the url when its own server requests that url. It's not getting that data from the client.
I currently developing this website "http://mica.com.my/cmstest/main/event.php".
I have few different content to be ready to post to facebook if user clicked the "Share" button. But when user click the share button it share the whole page which i don't wish to do that, how can i only share on the particular post's content to facebook but not the whole website page?
I had try to implement facebook api in it, but it still alway share the whole page instead of only the particular content to faccebook.
Please guide me through this. Thanks
you need to add meta description to the header.
<meta name="og:description" content="this will be the description shared on facebook">
you can also use other meta data like image , url and title. you can see all the otions in the docs
I have one button and I want to share the content on Facebook without opening Facebook dialogue box.
Present code works like:
Click on a button;
It opens Facebook share dialogue;
And again click on share from dialogue;
I want something like this: click on a button and it would be shared on Facebook.
https://developers.facebook.com/docs/graph-api/reference/v2.2/user/feed#publish
You would need to authorize the user with publish_actions to do that. You need to go through the Login Review process with that permission and the message parameter must be 100% user generated according to the platform policy.
A lot of things to consider, i´d just stick to the popup.
It used to be done this way:
<script src="http://static.ak.fbcdn.net/connect.php/js/FB.Share" type="text/javascript"></script>
<a type="button_count" share_url="http://google.pl" name="fb_share">Share this page on Your's wall</a>
And it used to generate a share button with text "Share this page on Your's wall" instead normal "Share". Since last update it doesnt work anymore.
Is there any posibillity to change the text on share button?
With Facebook JS SDK:
You now have to use the Feed Dialog, which is part of the Facebook JavaScript SDK.
Without Facebook JS SDK:
If you don't want to be bothered with their SDK, you can use this simple link instead:
Share this page on your wall
Here's what it'll look like if you're sharing Google.com with this link:
https://www.facebook.com/dialog/feed?app_id=140586622674265&link=http%3A%2F%2Fgoogle.com&name=Google&redirect_uri=http%3A%2F%2Fs7.addthis.com%2Fstatic%2Fpostshare%2Fc00.html
Also, please acknowledge these three things:
You need to replace [[URL]] and [[TITLE]] with a link to the page you want to share and its title (both url-encoded).
The Feed Dialog has to show from which Facebook app the post comes from. The app_id parameter in the URL above is the one from AddThis. Create a Facebook app and put its own id in the URL to use the name you want instead of "AddThis Sharing". You can keep the app_id from AddThis though, it works just fine.
The last parameter (redirect_uri) is the page where the user will be redirected after sharing. It's currently a page from AddThis with some JavaScript that will close the tab / window. That way, the dialog just disappears when it's not needed anymore. You don't have to change it either, works great.