Some browser has pluggin that scan and prefetch all link in a page...
Another advangate of button/POST instead of link/GET is the security.
Usualy the backend is protected by a login. If the user click on a link to a page and he is not logged in (or the session is expired), the requested url is saved and he is redirected to the login page.
After the login, the user will be redirected to the requested url.
You do not have permission to delete messages in this group
Copy link
Report message
Show original message
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to unpoly
If you don't respond to the GET request, or if you have a confirmation page on the GET request (which has a form to POST when they confirm), then you won't be affected by the pre-fetch that browsers may or may not do.
If you insist on using a button, you can easily make your own compiler paired with up.follow to simulate Intercooler, tho it's likely not needed.
Henning Koch
unread,
Mar 7, 2018, 12:57:08 PM3/7/18
Reply to author
Sign in to reply to author
Forward
Sign in to forward
Delete
You do not have permission to delete messages in this group
Copy link
Report message
Show original message
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to unp...@googlegroups.com
Nobody is proposing to delete an account in response to a GET request.
Server-side code that changes data should only respond to POST, PUT or
DELETE methods.
We're using JavaScript to make an <a> tag change its method from GET to
POST, the same way that Intercooler.js is using JavaScript to make a
<button> tag behave differently than it usually would.
You do not have permission to delete messages in this group
Copy link
Report message
Show original message
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to unpoly
I think that request a confirmation for each action is not correct: some action is reversible and ask for comfirmation is bad design.
Marco Staffoli
unread,
Mar 8, 2018, 4:50:33 AM3/8/18
Reply to author
Sign in to reply to author
Forward
Sign in to forward
Delete
You do not have permission to delete messages in this group
Copy link
Report message
Show original message
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to unpoly
Thank you Henning
By default I use:
- <a> to handle link to other pages - <buttons> to handle actions that change data on the server
Making this distinction I can handle browser prefetch pluggin that read the page html to call all the link in the page.
In the examples proposed on the tutorial of unpoly the solution to make a post request using up-method='post' is proposed inside a section that's called "link to a fragment" and the example use a <a> tag
That's not clear for a novice (like me) how to make a post to the server. For this reason I asked how to do here.