I currently rely on anchor tags to perform AJAX requests on my web application (using jQuery). For example:
<script type="text/javascript">
$(document).ready(function() {
$("#test").click(function() {
// Perform AJAX call and manipulate the DOM
});
});
<a id="test" href="">Click me!</a>
</script>
However, these anchor tags pretty much become useless if the user disables javascript in their browser. What's the best way to handle graceful degradation of these anchor tags? Is my only option to switch them all to buttons inside form tags?
Edit: I should be more clear and specify that my AJAX call is an HTTP POST to a URL that I cannot, for security reasons, expose to normal HTTP GETs (e.g. think of a delete url "/items/delete/1"). With that in mind, I can't change the href of the anchor to be "/items/delete/1" in order to satisfy users with javascript turned off since it poses a security risk.