I am trying to follow tecnhique of unobtrusive JavaScript / graceful degradation. I'd like to serve page with different links when JavaScript is turned on, and when JavaScript is turned off.
For example when JavaScript is turned off the link would be
<a href="script.cgi?a=action">
and when JavaScript is turned on
<a href="script.cgi?a=action;js=1">
(or something like that).
Both versions (with JavaScript and without JavaScript) of link lead to server side script, but with different parameters. The version that is meant to be called when JavaScript is turned off performs more on server, therefore it would be unproductive to detect JavaScript there (e.g. redirecting from server script for non-JavaScript to the other version via window.location
).
Note: I would prefer solution without using JavaScript libraries / frameworks like jQuery.