• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

cross-browser javascript

 
Ranch Hand
Posts: 86
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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";
}
}
 
author
Posts: 3252
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
This looks more like something for the HTML and JavaScript forum. Hold on while we beam you over...
- Peter
 
author
Posts: 15385
6
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
look at thos
http://www10.brinkster.com/A1ien51/Scripts/KeyCode.htm
Eric
 
reply
    Bookmark Topic Watch Topic
  • New Topic