4 ms·
Why do these need to be anything more than: <a href="https://www.facebook.com/.../share" target="_blank"> <img src="share_button.png"> </a> ?
by _bxg1 7y ago
Why do these need to be anything more than:
<a href="https://www.facebook.com/.../share" target="_blank">
<img src="share_button.png">
</a>
?
- oliwarner 7y agoYup, this is what I always do. All the major platforms allow you to pass through titles and other data to pre-populate the share box.
- ignoramous 7y agoA similar trick employed by businesses in Asia is to use the WhatsApp click to chat URL [0]: https://wa.me?text=Hello,World https://wa.me?text=Hello,World [0] https://faq.whatsapp.com/en/android/26000030/ https://faq.whatsapp.com/en/android/26000030/
- stevesearer 7y agoOne slight difference however is that on Facebook you have to use the 'share' button versus using a 'like' button. In some ways I feel like a share is more meaningful than a like due to the extra step involved.
- Semiapies 7y agoBecause they really should be small forms doing POSTs. There's no reason to recreate the mistakes of the early Aughts.
- _bxg1 7y agoThe problem is then you need JavaScript. Unless you want to show all of the form fields, all the time, on every page. Edit: You could probably hack around this with some CSS, but only relatively recently and browser support could be a challenge.
- WindyCityBrew 7y agohttps://developer.mozilla.org/en-US/docs/Web/HTML/Element/input/hidden https://developer.mozilla.org/en-US/docs/Web/HTML/Element/in...
- GordonS 7y agoI don't follow - what's the issue with plain old `a` and `img` tags?
- sansnomme 7y agoGET requests and web scrapers. Many a DB has been corrupted due to incompetent web devs not understanding http verbs. (In this specific case, it will most likely only ruin analytics. However, it's a good habit to use POST when you don't want automated access. E.g. if the social media also didn't implement their end properly and used GET requests for submission, the bot or crawler or whatever will fall through two layers of checks and your social media may be filled with gibberish, this scenario is however mostly theoretical. In general, you don't want a URL can modify state related to your core business logic. See HN's infamous "This Submission Upvotes Itself")
- GordonS 7y agoAh, sorry, I was thinking this was for buttons linking to a company/personal Facebook/Twitter oage - I didn't realise it was about Like/Share buttons. I was discussing this in another HN thread recently and my mind hadn't switched out yet :)
- kevin_thibedeau 7y agoThey're for old people apparently.
- chrismorgan 7y agoSurely this is a link to a Facebook page with the form, rather than actually performing the action? Because the latter would just be so exploitable.