Any methods to submit a POST request from a link if JS is disabled?
Ideeas so far (none of them perfect)
I need a fallback method for browsers without JS, and my area for these "buttons" is too small for buttons or images
To post HTML form data to the server in URL-encoded format, you need to make an HTTP POST request to the server and provide the HTML form data in the body of the POST message. You also need to specify the data type using the Content-Type: application/x-www-form-urlencoded request header.
You can't. A link is a GET, by definition. It is possible to style a form submit button to look like a link, though.
If a site is “client-side rendered” ( CSR ), that means JavaScript is doing the data fetching and creating the DOM and all that. If we're talking about websites “working” or not with or without JavaScript, a site that is client-side rendered will 100% fail without JavaScript.
You could make the button look like a normal link if you want using CSS?
Something like this perhaps?
<style type="text/css" media="screen">
input {
border: none;
background: none;
color: #00f;
text-decoration: underline;
cursor: pointer;
display: inline;
margin: 0;
padding: 0;
}
</style>
Click <input type="submit" value="here"/>!
Edit to add: The following CSS is just an example of how it might work, though not thorougly tested and to make it look like one of your normal links you might need to tweak it a bit.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With