PC SOFT

FOROS PROFESIONALES
WINDEVWEBDEV y WINDEV Mobile

Inicio → WEBDEV 2024 → Empêcher de sauver l'image.
Empêcher de sauver l'image.
Iniciado por Tom, 07,may. 2004 15:02 - 1 respuesta
Publicado el 07,mayo 2004 - 15:02
Bonjour,
y-a-t-il possibilité d'interdire à l'utilisateur du site de sauver une image
avec la touche droite de la souris?
Merci de votre aide.
Publicado el 09,mayo 2004 - 15:50
Voici un code Javascript que j'ai récupéré sur un site, je ne l'ai jamais
essayé.
Bon dev!


<html>
<head>
<title> </title>
<script LANGUAGE="JavaScript">
<!--
var msg = "Pas de clic droit !!! ";
function noclick(scx) {
if (navigator.appName == "Netscape" && scx.which == 3) {
alert(msg);
return false;
}
if (navigator.appVersion.indexOf("MSIE") != -1 && event.button == 2) {

alert(msg);
return false;
}
}

if (document.layers) {
document.captureEvents(Event.MOUSEDOWN);
}
if (navigator.appVersion.indexOf("MSIE") != -1)
document.onmousedown = noclick;
else if (document.layers)
document.onmousedown = noclick;
else if (document.getElementById) //NS6
document.onmouseup = noclick;
//-->
</script>
</head>

<body>

</body>
</html>