Skip to main content
added 29 characters in body
Source Link
Jamal
  • 35.2k
  • 13
  • 134
  • 238

Here I go,

Take care that I can read javascriptJavaScript but itsit was a whole time ago that I effectifly writeeffectively wrote in that.

First :

  1. I see you've created your own isNumeric function.

I see yo create your own isNumeric function.
MaybeMaybe you can use the isNaN. Documentation over here.

Second :

You use twice this :

((k > 64 && k < 91) || (k > 96 && k < 123) || k == 8);
  1. You use this twice:

     ((k > 64 && k < 91) || (k > 96 && k < 123) || k == 8);
    

If you use such a statement more thenthan once, you should consider refactorrefactoring to a method.

Third :

function onlyAlphabets(e, t) {
    try {
        if (window.event) {
            var charCode = window.event.keyCode;
        } else if (e) {
            var charCode = e.which;
        } else {
            return true;
        }
        if ((charCode > 64 && charCode < 91) || (charCode > 96 && charCode < 123) || (charCode === 8)) return true;
        else return false;
    } catch (err) {
        alert(err.Description);
    }
}

What is the meaning of t? (you don't use it)

Fourth :

function alpha(e) {
    var k;
    document.all ? k = e.keyCode : k = e.which;
    return ((k > 64 && k < 91) || (k > 96 && k < 123) || k == 8);
}
  1. What is the meaning of t? (you don't use it)

     function onlyAlphabets(e, t) {
         try {
             if (window.event) {
                 var charCode = window.event.keyCode;
             } else if (e) {
                 var charCode = e.which;
             } else {
                 return true;
             }
             if ((charCode > 64 && charCode < 91) || (charCode > 96 && charCode < 123) || (charCode === 8)) return true;
             else return false;
         } catch (err) {
             alert(err.Description);
         }
     }
    
  2. Very bad naming of method:

     function alpha(e) {
         var k;
         document.all ? k = e.keyCode : k = e.which;
         return ((k > 64 && k < 91) || (k > 96 && k < 123) || k == 8);
     }
    

Very bad naming of method first of all and don'tDon't you do it almost the same as the function mentioned in the third issue?

Here I go,

Take care that I can read javascript but its a whole time ago that I effectifly write in that.

First :

I see yo create your own isNumeric function.
Maybe you can use the isNaN. Documentation over here.

Second :

You use twice this :

((k > 64 && k < 91) || (k > 96 && k < 123) || k == 8);

If you use such statement more then once you should consider refactor to a method.

Third :

function onlyAlphabets(e, t) {
    try {
        if (window.event) {
            var charCode = window.event.keyCode;
        } else if (e) {
            var charCode = e.which;
        } else {
            return true;
        }
        if ((charCode > 64 && charCode < 91) || (charCode > 96 && charCode < 123) || (charCode === 8)) return true;
        else return false;
    } catch (err) {
        alert(err.Description);
    }
}

What is the meaning of t? (you don't use it)

Fourth :

function alpha(e) {
    var k;
    document.all ? k = e.keyCode : k = e.which;
    return ((k > 64 && k < 91) || (k > 96 && k < 123) || k == 8);
}

Very bad naming of method first of all and don't do it almost the same as the function mentioned in third issue?

Take care that I can read JavaScript but it was a whole time ago that I effectively wrote in that.

  1. I see you've created your own isNumeric function.

Maybe you can use the isNaN. Documentation over here.

  1. You use this twice:

     ((k > 64 && k < 91) || (k > 96 && k < 123) || k == 8);
    

If you use such a statement more than once, you should consider refactoring to a method.

  1. What is the meaning of t? (you don't use it)

     function onlyAlphabets(e, t) {
         try {
             if (window.event) {
                 var charCode = window.event.keyCode;
             } else if (e) {
                 var charCode = e.which;
             } else {
                 return true;
             }
             if ((charCode > 64 && charCode < 91) || (charCode > 96 && charCode < 123) || (charCode === 8)) return true;
             else return false;
         } catch (err) {
             alert(err.Description);
         }
     }
    
  2. Very bad naming of method:

     function alpha(e) {
         var k;
         document.all ? k = e.keyCode : k = e.which;
         return ((k > 64 && k < 91) || (k > 96 && k < 123) || k == 8);
     }
    

Don't you do it almost the same as the function mentioned in the third issue?

fixed some formatting
Source Link
Malachi
  • 29.1k
  • 11
  • 87
  • 188

Here I go,

Take care that I can read javascript but its a whole time ago that I effectifly write in that.

First :

I see yo create your own isNumeric function.
Maybe you can use the isNaN. Documentation over here.

Second :

You use twice this :

((k > 64 && k < 91) || (k > 96 && k < 123) || k == 8);

((k > 64 && k < 91) || (k > 96 && k < 123) || k == 8);

If you use such statement more then once you should consider refactor to a method.

Third :

function onlyAlphabets(e, t) {
    try {
        if (window.event) {
            var charCode = window.event.keyCode;
        } else if (e) {
            var charCode = e.which;
        } else {
            return true;
        }
        if ((charCode > 64 && charCode < 91) || (charCode > 96 && charCode < 123) || (charCode === 8)) return true;
        else return false;
    } catch (err) {
        alert(err.Description);
    }
}

}

What is the meaning of t? (you don't use it)

Fourth :

function alpha(e) {
    var k;
    document.all ? k = e.keyCode : k = e.which;
    return ((k > 64 && k < 91) || (k > 96 && k < 123) || k == 8);
}

Very bad naming of method first of all and don't do it almost the same as the function mentioned in third issue?

Here I go,

Take care that I can read javascript but its a whole time ago that I effectifly write in that.

First :

I see yo create your own isNumeric function.
Maybe you can use the isNaN. Documentation over here.

Second :

You use twice this :

((k > 64 && k < 91) || (k > 96 && k < 123) || k == 8);

If you use such statement more then once you should consider refactor to a method.

Third :

function onlyAlphabets(e, t) {
try {
    if (window.event) {
        var charCode = window.event.keyCode;
    } else if (e) {
        var charCode = e.which;
    } else {
        return true;
    }
    if ((charCode > 64 && charCode < 91) || (charCode > 96 && charCode < 123) || (charCode === 8)) return true;
    else return false;
} catch (err) {
    alert(err.Description);
}

}

What is the meaning of t? (you don't use it)

Fourth :

function alpha(e) {
    var k;
    document.all ? k = e.keyCode : k = e.which;
    return ((k > 64 && k < 91) || (k > 96 && k < 123) || k == 8);
}

Very bad naming of method first of all and don't do it almost the same as the function mentioned in third issue?

Here I go,

Take care that I can read javascript but its a whole time ago that I effectifly write in that.

First :

I see yo create your own isNumeric function.
Maybe you can use the isNaN. Documentation over here.

Second :

You use twice this :

((k > 64 && k < 91) || (k > 96 && k < 123) || k == 8);

If you use such statement more then once you should consider refactor to a method.

Third :

function onlyAlphabets(e, t) {
    try {
        if (window.event) {
            var charCode = window.event.keyCode;
        } else if (e) {
            var charCode = e.which;
        } else {
            return true;
        }
        if ((charCode > 64 && charCode < 91) || (charCode > 96 && charCode < 123) || (charCode === 8)) return true;
        else return false;
    } catch (err) {
        alert(err.Description);
    }
}

What is the meaning of t? (you don't use it)

Fourth :

function alpha(e) {
    var k;
    document.all ? k = e.keyCode : k = e.which;
    return ((k > 64 && k < 91) || (k > 96 && k < 123) || k == 8);
}

Very bad naming of method first of all and don't do it almost the same as the function mentioned in third issue?

Source Link
chillworld
  • 3.9k
  • 1
  • 23
  • 49

Here I go,

Take care that I can read javascript but its a whole time ago that I effectifly write in that.

First :

I see yo create your own isNumeric function.
Maybe you can use the isNaN. Documentation over here.

Second :

You use twice this :

((k > 64 && k < 91) || (k > 96 && k < 123) || k == 8);

If you use such statement more then once you should consider refactor to a method.

Third :

function onlyAlphabets(e, t) {
try {
    if (window.event) {
        var charCode = window.event.keyCode;
    } else if (e) {
        var charCode = e.which;
    } else {
        return true;
    }
    if ((charCode > 64 && charCode < 91) || (charCode > 96 && charCode < 123) || (charCode === 8)) return true;
    else return false;
} catch (err) {
    alert(err.Description);
}

}

What is the meaning of t? (you don't use it)

Fourth :

function alpha(e) {
    var k;
    document.all ? k = e.keyCode : k = e.which;
    return ((k > 64 && k < 91) || (k > 96 && k < 123) || k == 8);
}

Very bad naming of method first of all and don't do it almost the same as the function mentioned in third issue?