Create back button when JavaScript is disabled?

Is it impossible to create a back button in the browser using a form or link when custom javascript is disabled?

+3


source to share


5 answers


The easiest way to do this is on the server side. If you can get an HTTP Referrer (this is available in many server side languages), you can create a link and add it to the HTML page.



+4


source


It is impossible without server scripts.
but you can show a message like this:

1)



<noscript>
    Sorry, I can’t show you that information unless you enable 
        Javascript for your web browser. 
        To go back to where you were, just click/tap your "back" button.

    <style type="text/css">
        #main-content { display:none; }
    </style>
</noscript>

      

2)
or a page like this:
http://saveyourself.ca/help-no-javascript.php

+5


source


No server scripts? Not. It's impossible.

However, if you can run server-side scripts, you can save the referrer and create the link yourself ( <a href="{REFERRER}">Back</a>

). Please note that no browser will send the referrer.

+1


source


I believe you cannot use any javascript commands when it is disabled. However, you can still use the browsers back button (not 100% since I have never tried it), but if the user has javascript disabled, there won't be a lot of things on the website. And big websites usually won't let users do a lot if they don't have javascript. Example 1 - saving cookies and whatnot.

However, there are several ways to do this using PHP.

0


source


The server side can take HTTP_REFERER and dynamically add it to the current page. But if you know where they are likely to come from, you can simulate the back button by putting the most likely destination there as a link. More details

0


source







All Articles