admin管理员组文章数量:1418419
Im having a problem using an isNumeric jQuery function to check if a variable is a number.
I am getting an error
Uncaught TypeError: Object function (a,b){return new e.fn.init(a,b,h)} has no method 'isNumeric'
Here is my code
var scroll = 4;
$.isNumeric(scroll);
if (false) {
scroll = 0;
tabChange(menuTab, page, scroll);
} else {
tabChange(menuTab, page, scroll);
}
I thought this may be caused by having my code being run before jQuery has loaded but this is not the case.
Also the jQuery documentation is very unclear to me.
Im having a problem using an isNumeric jQuery function to check if a variable is a number.
I am getting an error
Uncaught TypeError: Object function (a,b){return new e.fn.init(a,b,h)} has no method 'isNumeric'
Here is my code
var scroll = 4;
$.isNumeric(scroll);
if (false) {
scroll = 0;
tabChange(menuTab, page, scroll);
} else {
tabChange(menuTab, page, scroll);
}
I thought this may be caused by having my code being run before jQuery has loaded but this is not the case.
Also the jQuery documentation is very unclear to me.
Share Improve this question asked Feb 24, 2012 at 13:12 UndefinedUndefined 11.4k5 gold badges39 silver badges62 bronze badges 01 Answer
Reset to default 5Which version of jQuery are you using? .isNumeric()
was added in 1.7, and if you're using an earlier version it's not available, which would give that error.
Another possibility is that you have Prototype or some other JS library running as well - try using jQuery.isNumeric(scroll);
instead of the $
notation.
本文标签: javascriptjQuery isNumeric throws error on consoleStack Overflow
版权声明:本文标题:javascript - jQuery $.isNumeric throws error on console - Stack Overflow 内容由网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://www.betaflare.com/web/1745276895a2651240.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论