Hacker Timesnew | past | comments | ask | show | jobs | submitlogin

Why do these need to be anything more than:

  <a href="https://www.facebook.com/.../share" target="_blank">
    <img src="share_button.png">
  </a>

?


Because they really should be small forms doing POSTs. There's no reason to recreate the mistakes of the early Aughts.


The 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.



Surely 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.


I don't follow - what's the issue with plain old `a` and `img` tags?


GET 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")


Ah, 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 :)


They're for old people apparently.


Yup, 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.


A similar trick employed by businesses in Asia is to use the WhatsApp click to chat URL [0]:

https://wa.me?text=Hello,World

[0] https://faq.whatsapp.com/en/android/26000030/


One 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.




Consider applying for YC's Summer 2026 batch! Applications are open till May 4

Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: