|
|
|||||||||
|
|||||||||
|
|||||||||
| |
||
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
#1
|
|||
|
|||
|
what is the function of the code?
<script language="javascript">
var isIE = document.all?true:false; var isNS = document.layers?true:false; function onlyDigits(e) { var _ret = true; if (isIE) { if ((window.event.keyCode < 46 || window.event.keyCode > 57) && window.event.keyCode != 45) { window.event.keyCode = 0; _ret = false; } } if (isNS) { if (e.which < 46 || e.which > 57||e.which!=45){ e.which = 0; _ret = false; } } return (_ret); } </script> |
|
#2
|
||||
|
||||
|
I guess the name says it all: it's been used to make sure one can only enter digits in an input box, like:
Code:
<input type=text onkeypress='return onlyDigits(event)'> |
|
#3
|
|||
|
|||
|
what about this?
Quote:
what about this ?? <script language=JavaScript> var message=""; /////////////////////////////////// function clickIE() {if (document.all) {(message);return false;}} function clickNS(e) {if (document.layers||(document.getElementById&&!document.all)) { if (e.which==2||e.which==3) {(message);return false;}}} if (document.layers) {document.captureEvents(Event.MOUSEDOWN);document. onmousedown=clickNS;} else{document.onmouseup=clickNS;document.oncontext menu=clickIE;} document.oncontextmenu=new Function("return false") // --> </script> |
![]() |
| Viewing: ASP Free Forums > Programming > HTML, JavaScript And CSS Help > what is the function of the code? |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|