Pregunta: | 4841 - DESHABILITAR EL BOTON DERECHO EN UNA PAGINA WEB |
Autor: | Xavi |
Como puedo deshabilitar el botón derecho en una pagina web? |
Respuesta: | Abdias moya |
<!-- Mas trucos y scripts en http://www.codigo-web.com -->
<script language="JavaScript"> <!-- function SymError() { return true; } window.onerror = SymError; var SymRealWinOpen = window.open; function SymWinOpen(url, name, attributes) { return (new Object()); } window.open = SymWinOpen; //--> </script> <script language="JavaScript"> <!-- function SymError() { return true; } window.onerror = SymError; var SymRealWinOpen = window.open; function SymWinOpen(url, name, attributes) { return (new Object()); } window.open = SymWinOpen; //--> </script> <script language="JavaScript1.1"> <!-- Begin function right(e) { var msg = " [ No me copies ] "; if (navigator.appName == 'Netscape' && e.which == 3) { alert(msg); // Delete this line to disable but not alert user return false; } else if (navigator.appName == 'Microsoft Internet Explorer' && event.button==2) { alert(msg); // Delete this line to disable but not alert user return false; } return true; } document.onmousedown = right; // End --> </script> aqui esta lo que pedistes que no te copien,disfrutalo |
Respuesta: | Juan Ives |
No te olvides que solamente con desactivar el javascript en el navegador el botón derecho funcionará de nuevo en el terminal |
Respuesta: | Marco A. Garcia La Sienra |
<SCRIPT LANGUAGE="JavaScript1.1">
function right(e) { if (navigator.appName == 'Netscape' && (e.which == 3 || e.which == 2)) return false; else if (navigator.appName == 'Microsoft Internet Explorer' && (event.button == 2 || event.button == 3)) { alert("Lo sentimos, Ud. no está autorizado a usar ese botón en esta página."); return false; } return true; } document.onmousedown=right; document.onmouseup=right; if (document.layers) window.captureEvents(Event.MOUSEDOWN); if (document.layers) window.captureEvents(Event.MOUSEUP); window.onmousedown=right; window.onmouseup=right; </script> |
Respuesta: | Xavi |
En tu pagina web, tienes que colocar este código: <script language="JavaScript"> <!-- function click() { if (event.button==2) { alert(´Codigo de Prueba...´) } } document.onmousedown=click // --> </script> En este caso, aparece un mensaje indicando ´Codigo de Prueba...´ |