Skip to content Skip to sidebar Skip to footer

Why Do I Have A JavaScript Parser Error With This Mask Code?

I have a JavaScript parser plug-in in Visual Studios 2012 and it is throwing an error at line 30 of this code, which is the closing curly brace for the $.mask piece from Mr. Bush:

Solution 1:

Maybe because of the additional comma after the placeholder: ... line?


Solution 2:

It looks like you've got an extra comma in there

$.mask = {
        //Predefined character definitions
        definitions: {
            '9': "[0-9]",
            'a': "[A-Za-z]",
            '*': "[A-Za-z0-9]"
        },
        dataName: "rawMaskFn",
        placeholder: '_'
        };

Solution 3:

    placeholder: '_',
};

There is a spare ,. It thinks that there should be one more member, but there isn't. Remove it and it will work.

    placeholder: '_'
};

The error comes from the line with }; because the error isn't the unneeded , but that the object ends before the last member.


Post a Comment for "Why Do I Have A JavaScript Parser Error With This Mask Code?"