Jay
Jay

Reputation: 87

Create browser back button when JavaScript disabled?

Is it impossible to create a browser back button, using a form or link, when a users javascript is disabled?

Upvotes: 3

Views: 5381

Answers (5)

antonjs
antonjs

Reputation: 14318

Without server-side-scripting is not possible.
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

Upvotes: 5

hellork
hellork

Reputation: 420

A server-side could take HTTP_REFERER and add it dynamically to the current page. But if you know where they will most likely be coming from, you can simulate a back button by putting the most likely return destination there as a link. More

Upvotes: 0

Grigor
Grigor

Reputation: 4059

I believe you can't use any javascript commands when it's disabled. However you may still use your browsers back button (not 100% on this since I've never tried it) but if the user has javascript disabled there are many things that won't work on the website. And the big websites usually won't allow users to do much if they don't have javascript enabled. 1 example is storing cookies and whatnot.

However, there are some ways of doing this using PHP.

Upvotes: 0

kemiller2002
kemiller2002

Reputation: 115538

The easiest way to do this is on the server side. If you can get the HTTP Referrer (this is available in many server side languages), then you can build a link and append it to the page's regular HTML.

Upvotes: 4

Zeta
Zeta

Reputation: 105955

Without server-side-scripting? No. It's not possible.

However, if you're able to run server-side-scripts, then you could save the referrer and create a link yourself (<a href="{REFERRER}">Back</a>). Note that some browser won't send a referrer.

Upvotes: 1

Related Questions