Win a copy of Programmer's Guide to Java SE 8 Oracle Certified Associate (OCA) this week in the OCAJP forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

cross-browser javascript

 
Sanjay Jadhav
Ranch Hand
Posts: 86
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi guies..
This javascript is use in both NS & IE browser...
if u guies knows where could i find cross-browser javascript examples. as i need it,and any javascript editor or debugger. im allready using netscape javascript debugger, abd i got netscape visual javascript but it's time is expried i need serial key for that.
var brName;
function forIE(event) {
if (event.keyCode < 48 || event.keyCode > 57) { event.returnValue = false; }
}
function checkBrowser(event) {
if(brName == "MIE") {
forIE(event);
}
if(brName == "NS") {
evt = (evt) ? evt : event;
var charCode = (evt.which) ? evt.which : evt.keyCode;
if(!(charCode == 48 || charCode == 49 || charCode == 50 || charCode == 51 || charCode == 52 || charCode == 53 || charCode == 54 || charCode == 55 || charCode == 56 || charCode == 57 || charCode == 8 || charCode == 13 || charCode == 9 || charCode == 0))
{
return false;
}else {
return true;
}
}
}
function setBrName(){
if(navigator.appName.indexOf("Netscape") != -1) {
brName = "NS";
}
if(navigator.appName.indexOf("Explorer") != -1) {
brName = "MIE";
}
}
 
Peter den Haan
author
Ranch Hand
Posts: 3252
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
This looks more like something for the HTML and JavaScript forum. Hold on while we beam you over...
- Peter
 
Eric Pascarello
author
Rancher
Posts: 15385
6
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
look at thos
http://www10.brinkster.com/A1ien51/Scripts/KeyCode.htm
Eric
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic