I have a JSMin-compressed Javascript file, composed mostly of jQuery libraries, and it causes IE9 and IE8 to throw the error SCRIPT16387: Invalid pointer. The line number given by IE corresponds to a couple custom jQuery validation methods:
jQuery.validator.addMethod("emaillist", function(value, element) {
return this.optional(element) || /^(\s*,?\s*[A-Z0-9._%+-]+@[A-Z0-9.-]+\.[A-Z]{2,4}\s*,?\s*){1,}$/im.test(value);
}, "Please specify at least one email address. Separate multiple addresses with a comma.");
jQuery.validator.addMethod("decimal", function(value, element) {
return this.optional(element) || /^-?\.?(?:\d+|\d{1,3}(?:,\d{3})+)(?:\.\d+)?$/im.test(value);
}, "Please enter a valid number.");
Googling shows all of 10 results for this error, and no solutions. Naturally, everything works find in Firefox/Chrome/Safari/etc. What’s wrong with my code?
I resolved the error by wrapping the above functions in jQuery’s: