POST with links without JavaScript

2019-07-07 20:57发布

Let's say I have a calendar on my page and clicking on a day would mark that day as complete. But I want to use POST and not GET, since GET is not suitable for this kind of stuff (changing something). And I also don't want to use JavaScript.

What I'm going for here is to build a page that will work without JavaScript (which I will use to "upgrade" the UI so that this updating is done via XHR) but I would also like to comply with how HTTP is meant to be used (this is what REST is about if I understand REST correctly).

So is there any way to do this, or is using links to change data the wrong approach from the start? If it is, the only viable solution (for my concrete problem) I can see is to use submit buttons for every day (along with a form for every day). But I'm more interested in the general idea here not just for my problem.

标签: html http rest
1条回答
▲ chillily
2楼-- · 2019-07-07 21:25

So is there any way to do this, or

No, there isn't.

is using links to change data the wrong approach from the start?

Yes, it is.

… although you could apply CSS to buttons.

查看更多
登录 后发表回答