How can I prevent the browser to scroll to the top on hash change?
问题 I am building a web application where I need to prevent back navigation in the browser history. After searching the threads in StackOverflow I found this: <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml" > <title>Untitled Page</title> <script type = "text/javascript" > function changeHashOnLoad() { window.location.href += "#"; setTimeout("changeHashAgain()", "50"); } function