We’re using JSON in some parts of our PHP project. The edit part has been programmed by JSON, so the href part contains something like below:
<a href="javascript:void(0);" id="button">Edit</a>
We want to check that if Javascript is disabled then change the URL as follow, because the above link would not work if JS is disabled:
<a href="./edit.php?id=12&text=some_text_here" id="button">Edit</a>
We tried <noscript>, but we gain no success. how to do something like above, we’re stuck here.
I appreciate in advance.
You can do something like this:
If you return
falsefrom your click handler, the Javascript-enabled browser will not navigate to the link’s location. When Javascript is disabled the link will be followed as normal.