In this line:

!!checkMobileOperator.check(input.val()) && submit.removeprop('disabled'); 

knocks out an error: Uncaught TypeError: checkMobileOperator.check is not a function

Here is the whole code: http://jsfiddle.net/t52ka/28/

    2 answers 2

    If the question is what kind of error, then:

    The checkMobileOperator object does not have a check method

    UPDATE :

    I would write like this:

    Announcement:

     var checkMobileOperator = (function() { return { check: checkFunction }; function checkFunction(arg) { // logic return result; } })(); 

    ....
    somewhere further
    ....

     checkMobileOperator.check(arg) 
    • fixed the errors you indicated: jsfiddle.net/t52ka/30 now crawled here: var checkMobileOperator = new checkMobileOperator (); do not tell me how to fix it? - Valeriy1996

    A lot of errors in the code:

    1. The variable which not defined;
    2. You have created the CheckMobileOperator object, and the check method is trying to call the сheckMobileOperator function;
    3. Next you will see an error with the submit.removeprop method which is not submit.removeprop , but submit.removeProp ;

    In JavaScript, the case of identifiers is important. Try to pay attention to it. And pay attention to the design code.

    • Plus for practical criticism - Stranger in the Q
    • @StrangerintheQ, like not even criticized. Showed where errors and advised what to look for. TC obviously mastered with JS, what is there to criticize. Everyone once starts - tutankhamun
    • Well, how would she have it =) - Stranger in the Q
    • I am surprised how the vehicle found an error with the check method. I haven’t yet corrected which on e.which received completely different errors - tutankhamun