Entradas

Mostrando entradas de octubre, 2018

JAVASCRIPT - DESHABILITAR RETROCESO, CONTROLAR REFRESH DE PÁGINA

<script type="text/javascript">             function deshabilitaRetroceso() {                     window.location.hash = "no-back-button";                     window.location.hash = "Again-No-back-button" //chrome                     window.onhashchange = function () {                     window.location.hash = "no-back-button";                 };             }             function control(evt) {                 if (a !== 1) {                     var msg = 'Si recarga la página perdera todos los datos ingresados.';                     evt.returnValue = msg;                     return msg;                 }             }             var a = 0;             function valor() {                 a = 1;             }             if ("url.pathname" === window.location.pathname) {                 window.addEventListener('beforeunload', control);             }         </script> Deshabil