Pain of browser back button [duplicate]

Asked
Active3 hr before
Viewed126 times

5 Answers

buttonbrowser
90%

Actually preventing the user from using the back or forward button is bad usability and will frustrate users a lot - to be blunt, it's passing a developer problem back to the user.,Is there any way using JavaScript(or something else) to detect/prevent that user clicked on browser back/forward button ? ,When the user clicks the back button, you leave the page, since it's the only one, and you can warn the user through the event window.onbeforeunload,you can make the back button actually do something useful, like going back to previous (valid) state, if possible.

Actually preventing the user from using the back or forward button is bad usability and will frustrate users a lot - to be blunt, it's passing a developer problem back to the user.

I think the Post/Redirect/Get pattern, coupled with window.onbeforeunload in javascript (like SO uses) would be really useful for your circumstances.

window.onbeforeunload
load more v
88%

I am working on a project in which i need to handle browser back button and on it's click I want to redirect to home page.,You can't just override a browser's button's behavior.,I am wondering, what is the best way to implement it.,Imagine the security problems it would cause if anyone could just "Fake" browser navigation like that. Making users think they navigated to a different site is chapter 1 in phishing for dummies...

I have used the following codes:

function HandleBackFunctionality() {
   alert('ckikc')
   if (window.event) {
      if (window.event.clientX < 40 && window.event.clientY < 0) {
         alert("Browser back button is clicked...");
      } else {
         alert("Browser refresh button is clicked...");
      }
   } else {
      alert('clicked')
      if (event.currentTarget.performance.navigation.type == 1) {
         alert("Browser refresh button is clicked...");
      }
      if (event.currentTarget.performance.navigation.type == 2) {
         alert("Browser back button is clicked...");
      }
   }
}
window.onbeforeunload = HandleBackFunctionality;
$(document).unload(HandleBackFunctionality);
72%

steps: Press browser back and then forward button after each other,Experiencing the same behavior as well and can replicate. Happens to all fields. Seems to only happen when the back button is pressed. Refresh fixes it but not ideal.,Actual: On browser back button:, Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

$(".selectdata").selectize({
   delimiter: ',',
   plugins: ['remove_button', 'stop_backspace_delete']
});
load more v
65%

If you start entering information into a Drupal form, accidentally click a link, then use the back button to go back to the form, ckeditor4 input is lost.,I like the save and continue editing button idea. I'm forwarding this post to the user experience group.,I came to this issue after loosing many hours of redaction work, and I have to say: WTF! Shame on all us!,I'm bumping this to "major"- we're getting a bunch of complaints about this behavior in 6.x from our clients, which I know is a self-selecting/unscientific polling method, but I have to believe this is causing a lot of pain to Drupal site owners and is really a pretty nasty little bug (borking the browser = bad).

I got this on a fresh install:

$ git apply drupal - form_values_to_localstorage - 153313 - 6526240. patch
drupal - form_values_to_localstorage - 153313 - 6526240. patch: 216: trailing whitespace.
$form['#attributes']['class'][] = 'form-save-to-localstorage-on-load';
error: core / misc / form.autosave.js: already exists in working directory
load more v
75%

First make a local copy of our 0_canvas_start.html file, and open it in your text editor., First make a local copy of our 0_canvas_start.html file, and open it in your text editor. ,The browser contains some very powerful graphics programming tools, from the Scalable Vector Graphics (SVG) language, to APIs for drawing on HTML <canvas> elements, (see The Canvas API and WebGL). This article provides an introduction to canvas, and further resources to allow you to learn more.,First of all, take a copy of your newly coded canvas template (or make a local copy of 1_canvas_template.html if you didn't follow the above steps).

<canvas width="320" height="240"></canvas>
load more v

Other "button-browser" queries related to "Pain of browser back button [duplicate]"