facebook

window.event.keyCode reference causing warning

  1. MyEclipse Archived
  2.  > 
  3. Web Development (HTML, CSS, etc.)
Viewing 4 posts - 1 through 4 (of 4 total)
  • Author
    Posts
  • #281122 Reply

    Mickey Barton
    Participant

    In my javascript file i have the reference

    window.event.keyCode

    which is generating the warning

    keyCode declaration is not found.

    I am using MyEclipseIDE 6.0.1

    Is this a bug in MyEclipse IDE

    #281128 Reply

    Loyal Water
    Member

    What file is this warning being reported in ? Can you paste the entire file here for me.

    #281148 Reply

    Mickey Barton
    Participant

    common.js

    contents are as follows:

    function isNumeric(obj,event) {

    if (window.event) {
    keycode = window.event.keyCode;
    //kc 9 = tab
    if (keycode == 9){
    return;
    }
    // keycode LeftArrow, RightArrow, UpArrow, DownArrow if so ignore
    if(keycode >= 37 && keycode <= 40){
    return;
    }
    }

    var num = obj.value;
    var ret = false;
    var newStr = “”;
    var badDigits = “”;

    for(var index = 0; index < num.length; index++) {
    var chkDigit = num.charAt(index);
    if(chkDigit >= 0 && chkDigit <= 9) {
    newStr = newStr + chkDigit;
    } else {
    badDigits = badDigits + chkDigit;
    }
    }
    obj.value = newStr;
    if(badDigits.length > 0) {
    if (num.length == 1) {
    window.alert(‘Invalid value was typed. (‘ + badDigits + ‘) will be replaced with 0 ‘ );
    obj.value = ‘0’;
    obj.focus();
    obj.select();
    ret = false;
    } else {
    window.alert(‘Invalid value was typed. (‘ + badDigits + ‘) will be removed. ‘ );
    obj.focus();
    ret = false;
    }
    } else {
    ret = true;
    }
    return ret;
    }

    #281181 Reply

    Loyal Water
    Member

    mlbartonsr,
    I was able to reproduce this warning at my end as well. I’ll log this for my dev team. Thank you for reporting this. I’ll keep you updated on this issue.

Viewing 4 posts - 1 through 4 (of 4 total)
Reply To: window.event.keyCode reference causing warning

You must be logged in to post in the forum log in