But I always wondered why there is no back to previous domain script
Often I leave some domain following a link, search through say 10 internal tabs, and want to return to the previous domain
is the a simple script for doing so?
would be a great help to create a button 'back to previous domain' on my website pages.
No. JavaScript does not have access to the browser history, so it can't scan the history to find the last URL from a different domain. Browsers make it pretty easy these days for users to handle this task, anyway. They can right-click on the 'Back' button to see a list of their recent history, or open links in new tabs or windows as they browse the web.
I agree that with browser history it is not that difficult
Am I suggesting something stupid that it seems possible
to fill a javascript variable with the javacript value 'history.back()
and then set a variable justenterednewdomain = false
'
to prevent changing the first variable, which then stores the
address of the previous domain?
Only I didn't succeed in programming this tric.
Do I miss a simple obstacle?
You really can't do anything with the broswer history except call the history.back() function. You can't change or access any of the values in the history. You probably don't want to manipulate the history.back() value anyway because it would interfere with the user's navigation through your own website.
You could check the document.referer property to see if (1) it's a valid URL, and (2) the domain is outside of your own. If the referer is a valid, outside domain, you could save that value in a cookie, and use that URL to create a clickable link for your users.
I'll have a look at 'document referrer'.
I never before stored info in a cookie, out of misplaced fear that cookies are temporary things. This is a fine reason to 'dive into' use of cookies
Soooo, you want to rewrite the browser history script/command/button? Why? Just either open new tabs or use the built in method. If the amount of hop backs is still not enough increase it by browser settings (if possible) or if not install an extension/plugin that does the job.
No, I have no intention to rewrite the history.back() button.
Lots of browsing people while browsing go to a site not by opening a new tab, but by using the same tab again.
Then after a lot of internal tabs it takes time to return to the entering external domain.
In the past Firefox used to have a fastforward and fastbackward button for this purpose.
Experienced browsers like you use browsing history, but for inexperienced users, like most of my readers, a button back to the domain where they came from is quite useful. Instead of x times using the back button.
In my wyzo version of FF there is only a back and a forward button.
I'll have a look at the settings. Anyway this fastbackward or fastforward is not available in IE9 or Chrome.
Last reply.
As far as I know Chrome can jump 3 pages back by rightclicking.
Am I mistaken?
IE8 had something similar
Chrome and IE give 85% of my visitors, and most of them never heard of this rightclick option.
I'm not interested in what YOU can do (sorry), but in what my visitors are able of doing
I never said anything about what they can do. Most users go by using programs without knowing a lot of useful features.
If you use PHP or other programming language that can handle sessions, you can track their EVERY movement and present them with a jump back history, no need of cookies or browser configuration/options.
Bookmarks