Originariamente inviato da stiffa
Ciao....
Ho problemi a gestire il tasto destro su firefox. Ho anche difficolta nel cercare informazioni riguardo a questo su web.
Per IE uso :
event.type e mi restituisce click o contexmenu....
Ma su FF ???
Cmq mi serve codice che vada bene per i due browser
proprio non capisco : qui parlano di event
http://developer.mozilla.org/en/docs/DOM:event
ma su FF se faccio alert(event) mi dice che event is not defined...
Booooh....le sto provando tutte....l'unico alert che son riuscito a far saltar fuori e'
alert(Event.CLICK) ....
Ma il resto?
per fare prima ti posto il codice:
codice:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<title>Documento senza titolo</title>
<style>
medio {font-size: 10px;}
grande {font-size: 20px;}
</style>
<script type="text/javascript">
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("Spiacenti, il tasto destro del mouse e' disabilitato");
return false;
}
return true;
}
document.onmousedown=right;
if (document.layers) window.captureEvents(Event.MOUSEDOWN);
window.onmousedown=right;
// End -->
</script>
<meta http-equiv="Pragma" content="no-cache" />
<meta http-equiv="Expires" content="-1" />
<meta http-equiv="Cache-Control" content="no-cache" />
<noscript>
<meta http-equiv="refresh" content="0;URL=errore.html" />
</noscript>
</head>
<body oncontextmenu="alert('Spiacenti il tasto destro del mouse e\' disabilitato');return false;">
<table width="230" border="0" cellspacing="0" cellpadding="0">
<tr>
<td width="230"></td>
</tr>
</table>
<table width="100%" border="1" cellpadding="0" cellspacing="0" id="tab_1">
<tr>
<td></td>
</tr>
</table>
</body>
</html>
Prima di cercare sul web dovevi cercare sul forum un argomento trattato almeno un fantastigliardo di volte :rollo:
Sicuramente saprai che non serve assolutamente a niente, se non lo sai te lo dico io