wood burning stoves 2.0*
The moose likes HTML, CSS and JavaScript and the fly likes cross-browser javascript Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Murach's Java Servlets and JSP this week in the Servlets forum!
JavaRanch » Java Forums » Engineering » HTML, CSS and JavaScript
Bookmark "cross-browser javascript" Watch "cross-browser javascript" New topic
Author

cross-browser javascript

Sanjay Jadhav
Ranch Hand

Joined: Feb 21, 2002
Posts: 86
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";
}
}


Sanjay Jadhav<br />Sun Certified Programmer For Java 2 Platform
Peter den Haan
author
Ranch Hand

Joined: Apr 20, 2000
Posts: 3252
This looks more like something for the HTML and JavaScript forum. Hold on while we beam you over...
- Peter
Eric Pascarello
author
Rancher

Joined: Nov 08, 2001
Posts: 15376
    
    6
look at thos
http://www10.brinkster.com/A1ien51/Scripts/KeyCode.htm
Eric
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: cross-browser javascript
 
Similar Threads
scroll bars - vertical
Problem with text box
how to create small windows
Problem With Ctrl C/V in Firefox after validating an input
Capture multiple Key Press ctrl+p?