Click here to Skip to main content
15,913,773 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
dear friends,


I have Question For U..

how to disable Back-Button in Browser while running applications using mobile application . and Does Not Page Refreshing or Reload.
While pressing Back Button.
????
Posted

1 solution

You cannot actually DISABLE the back button of the browser because whatever content is running inside the browser window has no access to browser menu items.

However, the same effect can be created using some javascript hacks. Here is one of the trick that worked for me..

HTML
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 changeHashAgain() { 
  window.location.href += "1"; 
} 
 
var storedHash = window.location.hash; 
window.setInterval(function () { 
    if (window.location.hash != storedHash) { 
         window.location.hash = storedHash; 
    } 
}, 50); 
 
 
</script> 
</head> 
<body onload="changeHashOnLoad(); "> 
Try to hit the back button! 
</body> 
</html> 
 
Share this answer
 
Comments
vilas_gaykwad@yahoo.co.in 5-Jun-12 8:40am    
But When I have set 1400px width of the page, at that time it's not allow me to scoll the page horizontally or virtically.

Please advice me..thanks

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900