Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- jQuery(document).ready(function($) {
- if (window.history && window.history.pushState) {
- $(window).on('popstate', function() {
- var hashLocation = location.hash;
- var hashSplit = hashLocation.split("#!/");
- var hashName = hashSplit[1];
- if (hashName !== '') {
- var hash = window.location.hash;
- if (hash === '') {
- alert('Back button was pressed.');
- window.location='www.example.com';
- return false;
- }
- }
- });
- window.history.pushState('forward', null, './#forward');
- }
- });
- $(window).bind('onpopstate', function(e){
- //your dark doings here
- });
- bajb_backdetect.OnBack = function(){
- document.location.href = 'http://google.com';
- }
Add Comment
Please, Sign In to add comment